summaryrefslogtreecommitdiffstats
path: root/src/gui
Commit message (Collapse)AuthorAgeFilesLines
* Use QVector::reserve() all over the place.Sérgio Martins2015-06-293-2/+7
| | | | | | | | | | | | Reduces internal memory fragmentation. The search criteria was: QVector::append(), QVector::push_back(), QVector::operator<<() and QVector::operator+=() calls inside for, do and while loops. Statements inside ifs and out of loops weren't considered. Change-Id: Ie5aaf3cdfac938994e6e5dfa5f51de501ed79a0c Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Do not use 16 bits per color on GLESLaszlo Agocs2015-06-294-17/+75
| | | | | | | unless GL_EXT_texture_norm16 (and so GL_RGBA16) is present. Change-Id: Ic15b81b8134fda147e96301b7f78cabe07a05d9e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* QRasterPaintEngine: Don't detach QImageSérgio Martins2015-06-291-3/+3
| | | | | | | | | | Caught being detached a few thousand times per second. Change-Id: I9f3c80cc5178ec2016041a4f2f6e6e1f458171f1 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Add support for driver_description and os.release in GPU blacklistsLaszlo Agocs2015-06-262-33/+97
| | | | | | | | | | | | | | | | | | | | os.version is the kernel version which is just not very useful or easy to use for us. Instead, introduce a string that allows easy differentiation between Windows 7 and 8. From the adapter identifier the driver description is often helpful too, especially in virtual machines. These allow writing rules like: { "description": "Use WARP in some Win 8 and 8.1 VMs", "os": { "type": "win", "release": [ "8", "8.1" ] }, "driver_description": "VMware SVGA 3D", "features": [ "disable_desktopgl", "disable_d3d9", "disable_d3d11" ] } Change-Id: I196f6b44d7bb9e42ef47f61f4c28d8aa79afb7c4 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Micro-optimize QKeySequence datastream operator (I)Marc Mutz2015-06-241-8/+7
| | | | | | | | | Instead of creating a QList with the keys with one of two statically known sizes, stream the contents itself. Apart from QDataStream, this no longer allocates any memory. Change-Id: I5ed814b186dcaf8cc7dedcc520928aefab01f009 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QPicture: don't hold images in QListMarc Mutz2015-06-241-1/+1
| | | | | | | | | | | QImage is larger than a void*, so holding them in a QList 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. Change-Id: I153995d691692f7317cab31b95a00d679f31c0af Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* QPicture: don't hold pixmaps in QListMarc Mutz2015-06-241-1/+2
| | | | | | | | | | | QPixmap is larger than a void*, so holding them in a QList 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. Change-Id: I82bb9a88e7030e566f39421cd78babcf01bce285 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QZip*: mark various types movable and primitiveMarc Mutz2015-06-242-0/+10
| | | | | | | | ... even if they are not (currently) held in Qt containers (though FileInfo is). Change-Id: Id14d4af89fed8bcefdbb9b28d11c1c43fccf7190 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QtGui: don't hold QPainterPath in QListMarc Mutz2015-06-242-4/+4
| | | | | | | | | | QPainterPath isn't marked movable , so holding them in a QList 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. Change-Id: Id4dae8037401c52fd57a2274e45399a9b70beb69 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Revert "windows: Disable D3D9/11 with ANGLE in VMs"Laszlo Agocs2015-06-232-14/+2
| | | | | | | | | | | | This reverts commit a6000e2b6679d91c9dab44e49b485de6816372bc. Temporarily remove this to unblock the qtdeclarative dev CI. While Windows 8 VMs are fixed by this patch, Windows 7 has different problems. Change-Id: I45ef064ed953cc4b7bbf19657300d4fc43d82452 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* QTextureGlyphCache: add some qMove()Marc Mutz2015-06-221-2/+2
| | | | | | Change-Id: I1965f4de0f1bf9efdb15d07142f882897e163cc5 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* gui: Add several QList::reserve() calls.Sérgio Martins2015-06-2217-16/+40
| | | | | | | Reduces reallocations. Change-Id: I0db16726f413a67b76a73fabd013f910ab5f5109 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Export gamma setting and metadata in QImageReaderAllan Sandfeld Jensen2015-06-223-9/+49
| | | | | | | | | | | | The PNG image plugin has the capability of applying gamma correction to read PNGs, but doesn't do so by default, and we export no way of accessing this through the qimagereader API. This patch adds the ability to read the PNG file gamma, and overriding decoded gamma to get gamma correction. Change-Id: Iaf9eaac0827516db6bc02247c58026270cd1f610 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* QIcon: don't use a QList<QImage>Marc Mutz2015-06-221-2/+2
| | | | | | | | | | | QImage is larger than a void*, so holding them in a QList is needlessly inefficient. Use QVector instead. Change-Id: Ifcc9eca18a87e29327586506e3a3bb7874c8b3a7 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* QTextDocumentLayout: don't hold QPointers in QListMarc Mutz2015-06-221-1/+1
| | | | | | | | | | | QPointer is larger than a void*, so holding them in a QList 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. Change-Id: I104d11cc530c9c1579e82bf4e28e3353c00b34b4 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QTextureGlyphCache: don't use a QList<QImage>Marc Mutz2015-06-221-8/+11
| | | | | | | | | | | | | | QImage is larger than a void*, so holding them in a QList is needlessly inefficient. In this case, the maximum size of the container is a small compile-time constant, so the best container to hold those QImages is a C array, even though it will default-construct all 12 QImages before even starting the loop, since the QImage constructor does not allocate memory. Change-Id: I83ca65aa1ca51c400ca696202d24cfaeab505a5b Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* QFontSubset: mark local types movable and hold in QVector, not QListMarc Mutz2015-06-202-19/+24
| | | | | | | | Virtually all of these types are too large to fit into a QList. Change-Id: If55496ef3fb26d6531e9ef1bb1558887d9077a3b Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Remove quadratic behavior in QFontDatabase::writingSystems()Marc Mutz2015-06-191-8/+16
| | | | | | | | | | | | | | | | | Looping over QList::contains() constitutes O(N²) behavior, the more so as this QList is horribly inefficient since WritingSystem is not a Q_MOVABLE_TYPE. Since the range of possible unique values in the result is severly limited (by virtue of being enumerated values), use a bitmask to remember which WritingSystems were encountered, then, after releaseing the mutex again, use that bitmask to populate the QList. Change-Id: I1d12eb487513ec17faa6f38942f8b681819dc0e8 Reviewed-by: Adam Majer <adamm@zombino.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* windows: Disable D3D9/11 with ANGLE in VMsLaszlo Agocs2015-06-192-2/+14
| | | | | | | | | | | | | | | | By adding support for the driver description, we can detect if we are in VMware. In this case D3D9 and 11 get disabled, so only the software-based options are in use. This allows running autotests like tst_qopengl, tst_qopenglwidget, tst_qgl, etc. in the Qt CI system. There OpenGL 2.x is not available, so ANGLE is the only option. D3D11 is not an option, so it picks D3D9 by default. However, this results in mystic failures. The stable solution seems to be to use WARP. This can be achieved by setting disable_d3d9 in the built-in GPU blacklist. Change-Id: I937c4b3fa82fc1a2d524b4eb712732722df2070c Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Move-enable QPixmapCache::KeyMarc Mutz2015-06-192-0/+24
| | | | | | | | The default constructor already sets the d-pointer to nullptr, so the move constructor does not introduce a new state. Change-Id: Icd47952bdf76d2106992d6babea40d68f18d067e Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QPixmapCache: remove unused Q_TEST_QPIXMAPCACHE-only functionMarc Mutz2015-06-192-25/+0
| | | | | | | | Unused by tst_qpixmapcache.cpp and everything else, and uses an inefficient QList, so remove. Change-Id: Ia410ed19db9bb3db97460b21bc2fd9d53c95a73d Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Use Q_GLOBAL_STATIC for QThreadStorage<QGuiGLThreadContext *>Sérgio Martins2015-06-191-5/+5
| | | | | | | | | QThreadStorage isn't a trivial type. Change-Id: Iedc3c16320fd025a0ccf627eac43a85ebd02aa5e Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Don't define qAccessiblePlugins if we cannot use them.Ulf Hermann2015-06-161-2/+2
| | | | | | | In case of QT_NO_LIBRARY there are no plugins after all. Change-Id: Iad891d0cf0edf9e4418a4fe4ac49cf6497ceeb79 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* Micro-optimize QKeySequencePrivate::decodeString()Marc Mutz2015-06-151-1/+1
| | | | | | | Use a QStringRef instead of a QString. Change-Id: I63bf9775606b071cd9614306375e1316dada9f61 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Don't try to load opengl extensions or functions without QLibraryUlf Hermann2015-06-122-3/+9
| | | | | Change-Id: If77ca6e04c83d94fd3063b68963b1bcd90980d99 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Mark unused parameters with Q_UNUSEDUlf Hermann2015-06-123-0/+13
| | | | | | | | This prevents compiler warnings on less common branches of certain ifdefs. Change-Id: I89bae68491151b21cf6887a854cc4c9f68838cf9 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QTouchDevicePrivate: deal in const QTouchDevice*sMarc Mutz2015-06-122-12/+7
| | | | | | | | | | | Avoids the copying of the contents when returning devices(). Remove an unneeded #include (already includes by public header; unneeded there, too, but leaving for SC purposes). Change-Id: Ifa9a3dc2c7fada01fb624527dd4d16d0cb32a658 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Remove unused and unneeded subimage scalingAllan Sandfeld Jensen2015-06-092-119/+75
| | | | | | | | | Removes the feature of scaling only a clipped area of the input which was unused and only made the code harder to read and maintain. Change-Id: I296a804a5bd083016fbc47543e00eb586b530d71 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Export class QAccessible::ActivationObserver.Friedemann Kleint2015-06-081-1/+1
| | | | | | | | Change a21dfab54ed518266c42d3e87e02bd991de8486e de-inlined its destructor, so, the class needs to be exported. Change-Id: I32d21622a944a93718f549060e5e5f7e71fd2646 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* doc: Remove uses of \mainclassMartin Smith2015-06-053-3/+0
| | | | | | | | This qdoc command is deprecated. Task-number: QTBUG-46476 Change-Id: Iee36f91bdcf500c2e88022a5f8a9c3accc6048c2 Reviewed-by: Martin Smith <martin.smith@digia.com>
* Merge "Merge remote-tracking branch 'origin/5.5' into dev" into refs/staging/devSimon Hausmann2015-06-0472-583/+846
|\
| * Merge remote-tracking branch 'origin/5.5' into devSimon Hausmann2015-06-0372-583/+846
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qnamespace.qdoc src/corelib/io/qwindowspipereader.cpp src/corelib/io/qwindowspipereader_p.h src/corelib/statemachine/qstatemachine.cpp src/corelib/statemachine/qstatemachine_p.h src/plugins/platforms/xcb/qxcbconnection.h tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp tests/auto/tools/qmake/tst_qmake.cpp tests/manual/touch/main.cpp Change-Id: I917d694890e79ee3da7d65134b5b085e23e0dd62
| | * Merge "Merge remote-tracking branch 'origin/5.5.0' into 5.5" into ↵Liang Qi2015-06-022-7/+4
| | |\ | | | | | | | | | | | | refs/staging/5.5
| | | * Merge remote-tracking branch 'origin/5.5.0' into 5.5Liang Qi2015-06-022-7/+4
| | | |\ | | | | | | | | | | | | | | | Change-Id: I060b0e10e55487a4a4a101f77ad7c8dc8cf0f553
| | | | * Merge "Merge remote-tracking branch 'origin/5.4' into 5.5" into ↵Jani Heikkinen2015-06-022-7/+4
| | | | |\ | | | | | | | | | | | | | | | | | | refs/staging/5.5.0
| | | | | * Merge remote-tracking branch 'origin/5.4' into 5.5Liang Qi2015-06-012-7/+4
| | | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/generators/mac/pbuilder_pbx.cpp src/corelib/global/qglobal.h Change-Id: I2c0f7544bf194f2d0f59218fd583c822901487b0
| | | | | | * Merge remote-tracking branch 'origin/5.4.2' into 5.4Liang Qi2015-05-291-7/+0
| | | | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ied2a227a25859163a924c7b5717492a1f974c5ca
| | | | | | | * Do not modify decoder when determining image-formatAllan Sandfeld Jensen2015-05-211-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We should not configure the decoder when just determining the image- format. Doing so can cause all versions of libpng to print a warning, and some versions to fail to decode. The code appears to be a leftover from when the image-format logic was copied out of the introduction of the decoding method, where the proper settings are still applied. Task-number: QTBUG-46233 Change-Id: I6619728804f040ae6c9d637c7298a8586e22499e Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com> Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com>
| | | | | | * | Handle parsing of GL_VERSION as reported by Nexus 6Andy Shaw2015-05-111-0/+4
| | | | | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Nexus 6 device reports a GL_VERSION which is strictly not conformant to what is expected from GL_VERSION, so a check is added for this case so that it correctly detects the right OpenGL ES version. Change-Id: I00297dd7c1e505dd7f9ab8a7fa480f514162b488 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
| | * | | | | Don't assign iterator to const_iteratorSérgio Martins2015-06-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It should also be possible to use QT_STRICT_ITERATORS in Qt's own code base Change-Id: I0914db480d4d2b06e71e3a2588163efdd3ff6d27 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * | | | | Syntax clean up in qimagescaleAllan Sandfeld Jensen2015-06-021-27/+26
| | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Corrects a few white-spaces, return statements and else statements to fit Qt coding style. Comment updated to indicate how far the code is getting from its original roots. No semantic changes. Change-Id: Ia2288c501788a291bfc4e8b70e8eb1efb7a90128 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
| | * / / / Fix wrong method name in QColor documentationAllan Sandfeld Jensen2015-06-011-4/+4
| | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The methods are called hslHue and hslSaturation. This was leading to dead links. Change-Id: I0997c415958aae9a66fb037d98f8ad3d43b38231 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
| | * | | Avoid QWidget dependency in QtGuiLaszlo Agocs2015-06-012-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's not a real dependency as all we need is to store a pointer, but better not to use the name QWidget at all. Change-Id: I30ef1dd44ac7e42c1b9c84675f94088b8c516076 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
| | * | | Clip QOpenGLWidget and QQuickWidget correctlyLaszlo Agocs2015-06-012-16/+47
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce support for the widgets' clipRect(). Right now render-to-texture widgets in scroll areas placed close to each other result in broken (non-existent) clipping. Similarly, stack-on-top widgets fail to clip when placed inside a scroll area. This is now corrected and the qopenglwidget example is enhanced to utilize a scroll area. Task-number: QTBUG-45860 Change-Id: I859a63d61a50d64ba9e87244f83c5969dce12337 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
| | * | Combine x and y oriented sample helpersAllan Sandfeld Jensen2015-05-302-120/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The range sampling operates the same in both directions just with different step-sizes, so the code can be unduplicated, Change-Id: I47805a7e925d4058f62c558ef08e79485915e937 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
| | * | Remove unused call indirectionAllan Sandfeld Jensen2015-05-301-20/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The global variable is a left over from when there was an MMX assembler implementation, and is now just making the compiler's job harder. Change-Id: I686704b64a2f8c68ec8ca83f2ac3e465ded773e0 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * | QtGui/Windows: Fix static build.Friedemann Kleint2015-05-271-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qtbase\src\gui\kernel\qgenericpluginfactory.cpp:70: error: C2220: warning treated as error - no 'object' file generated qtbase\src\gui\kernel\qgenericpluginfactory.cpp:70: warning: C4100: 'specification' : unreferenced formal parameter Change-Id: I2dbb114fa9feaf862b4554b128caca0dcb5e291e Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
| | * | QOpenGLWindow: initializeGL is to be called before resizeGLLaszlo Agocs2015-05-271-114/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This involves deinlining some private class stuff to keep things readable and maintainable. Task-number: QTBUG-46002 Change-Id: Ie2888aa6c16a6f5182b61fbaa43288cfcc96cbc4 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
| | * | Fix failing input device notifications on embeddedLaszlo Agocs2015-05-272-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The connection to the deviceListChanged() signal may be queued. To make it work our custom types have to be registered. The problem is only visible with input backends like evdevtouch that live on their own thread. Task-number: QTBUG-46069 Change-Id: I4c03e8031e4337b5e711a3bd2cf405d15d6ce214 Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com>
| | * | Adjust curveThreshold based on strokeWidthAllan Sandfeld Jensen2015-05-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently curveThreshold is relative to pen width, this allows wide pen to be increasingly off target. This patch adjust the curveThreshold relative to stroke width, thereby ensuring wide pens stays on the curve. Task-number: QTBUG-46151 Change-Id: Ifd4371aa2853331d02e3c6f6565c243eb1b7ed2e Reviewed-by: Gunnar Sletta <gunnar@sletta.org>