summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
Commit message (Collapse)AuthorAgeFilesLines
* Update freetype to 2.12.1Volker Hilsheimer2022-07-221-1/+1
| | | | | | | | | | | | | | ftdebug.c files are new, adapted the import script to copy the source file for Windows as well. Replaced the CMakeLists.txt content that was imported from the .pro file with the respective variables and logic from the freetype CMakeLists.txt file, which should make it easier to maintain this next time. Pick-to: 6.4 6.3 6.2 5.15 5.12 Fixes: QTBUG-105032 Change-Id: I1e846167b268df4b1b0a50dcec602def1a0bdcb4 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Undeprecate QColor(string) constructorsVolker Hilsheimer2022-07-212-14/+1
| | | | | | | | | | | | | They are used in a lot of code, deprecating them now just creates noise and porting effort without adding any value. For Qt 7 we can remove them if we deprecate them in time for the last Qt 6 release, at which point porting effort is expected anway. Leave a ### comment behind to that effect. Pick-to: 6.4 Change-Id: I0a4e78cf1723b02373d23d7cd52783b3f7095428 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* QColorTransform: remove unimplemented function from the private classVolker Hilsheimer2022-07-191-1/+0
| | | | | | | | | QColorTransformPrivate::simpleGammaCorrection is not implemented anywhere, so remove the declaration. Pick-to: 6.4 Change-Id: I07debd84e49389a0f1ef1b3798f809447a342f3a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Relayout QStaticText when dpi changesEskil Abrahamsen Blomfeldt2022-07-141-1/+4
| | | | | | | | | | | | | | | | | If the cached font has a different DPI than the one used in QPainter, we need to treat this the same as if other font properties have changed and redo the layout. This happened when running the QStaticText test on Wayland, because the default dpi was 100 and the QPixmap we ended up drawing to was 96. This caused the pixel size of the font to be calculated differently when doing drawText() (using 96 dpi) and drawStaticText() (using the cached 100 dpi). Pick-to: 6.4 Fixes: QTBUG-100982 Change-Id: Ie4270341bb8a64b6458eb67ba460a282c65dc26b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Port QFontSubset API from int to qsizetypeMarc Mutz2022-07-081-3/+3
| | | | | | | | | Removing the impedance mismatch with the Qt containers. Pick-to: 6.4 Task-number: QTBUG-104814 Change-Id: I141d9056249644b90c404219792e0fcd87960f7c Reviewed-by: Lars Knoll <lars.knoll@gmail.com>
* Port QTextureGlyphCache to qsizetypeMarc Mutz2022-07-082-5/+5
| | | | | | | | | Reduces impedance mismatch with other Qt containers. Pick-to: 6.4 Task-number: QTBUG-104820 Change-Id: Ie8830a404240f34acc790296b608e1318c46535d Reviewed-by: Lars Knoll <lars.knoll@gmail.com>
* Port QDataBuffer to qsizetypeMarc Mutz2022-07-081-9/+9
| | | | | | | | | | | | | | | | Reduces the impedance mismatch with "normal" Qt containers. Remove useless inline keywords as a drive-by. Functions defined in the class body are implicitly inline since C++98. C++ declarations are long-winded enough as they are, no need to add more cruft. Also make the ctor explicit, we surely didn't intend to allow implicit conversion from qsizetype to QDataBuffer Pick-to: 6.4 Task-number: QTBUG-104825 Change-Id: I563dcd825afd63937b87e87fbbd324daaeb49d08 Reviewed-by: Lars Knoll <lars.knoll@gmail.com>
* Gui: mark types Q_PRIMITIVE_TYPE when they're held in QDataBufferMarc Mutz2022-07-083-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QDataBuffer assumes that its template argument is a POD, iow: it's ok to not run ctors and dtors and assign a value into uninitialized memory. In Qt, we call that Q_PRIMITIVE_TYPE. Asserting that the QDataBuffer value_type is not QTypeInfo::isComplex, however, has shown that a large number of types had not been marked as such, sometimes for good reason, e.g. because their default constructor doesn't value-initialize all members, but sets some of them to -1. Since QDataBuffer doesn't memset the memory to zero, it doesn't matter, as the code obviously has to have worked before, with uninitialized memory, and all-zeros is just a special, if common, form of uninitialized memory. I also tried to assert is_pod in QDataBuffer (working around the fact that that particular trait is deprecated), but found that almost none of the types in question were, in fact, trivial. We should fix this, because it means the compiler is generating code that's less efficient than it could be, but that's for another patch. All types marked as Q_PRIMITIVE_TYPE in this patch are private API, so this doesn't affect users. For PathSimplifier::Event, had to shorten the unnamed namespace to not include the member functions, because Q_DECLARE_TYPEINFO cannot appear in a namespace other than the Qt one. Pick-to: 6.4 6.3 Change-Id: I4431a2f269ec1ac4804a87ea71f983eaa34ef867 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Lars Knoll <lars.knoll@gmail.com>
* Pass QFixed by valueMarc Mutz2022-07-081-18/+18
| | | | | | | | | It's a glorified int, so pass it by value instead of cref. Pick-to: 6.4 Change-Id: I1c7a37614cd0d2dac63d2d549563600d401d6dad Reviewed-by: Sérgio Martins <sergio.martins@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@gmail.com>
* QFixed: add implicit conversion from long longMarc Mutz2022-07-081-0/+1
| | | | | | | | | This will come in handy when porting some GUI code to qsizetype. Pick-to: 6.4 Task-number: QTBUG-104818 Change-Id: I426a4f425ebd7a9fdc2d2bba97dae4c640ded97e Reviewed-by: Lars Knoll <lars.knoll@gmail.com>
* QFixed: stream-line relational operatorsMarc Mutz2022-07-081-19/+11
| | | | | | | | | | | | - make them hidden friends - take lhs and rhs each by value - noexcept - remove useless mixed relational operators with int: Every fix op i is now compiled as fix op QFixed(i) with no loss in performance. Pick-to: 6.4 Change-Id: If4d0a43fd964547de59fed4ba2cdfea0cf176809 Reviewed-by: Lars Knoll <lars.knoll@gmail.com>
* QFixed: remove user-defined assignment operatorsMarc Mutz2022-07-081-3/+0
| | | | | | | | | | | | | | | | | They don't give us anything: For every op=(X), there's an implicit QFixed(X) constructor that will resolve any fix = x; as fix = QFixed(x); with no performance penalty. Pick-to: 6.4 Change-Id: Ia5b0364617a646f3cf122b47363d6099548bb5c2 Reviewed-by: Lars Knoll <lars.knoll@gmail.com>
* QRasterPaintEngine: replace a QPair with a structMarc Mutz2022-07-081-16/+22
| | | | | | | | | | Gives better naming for the members. A range consists of {begin, end}, not {first, second}. Pick-to: 6.4 Task-number: QTBUG-104818 Change-Id: I3d6c7be2a137e1c03149d1d86ce9db38ec28a1fb Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Remove Q_DECL_VECTORCALL when SSE2 is not availableAllan Sandfeld Jensen2022-07-051-2/+6
| | | | | | | | | | It expands to sseregparm in gcc, and then can't build with SSE2 disabled. Pick-to: 6.4 6.3 6.2 Fixes: QTBUG-104726 Change-Id: I063ed87ed7f7ba683a19cd3f6e8a25c5111ef72a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* rhi: Make it possible to query the backend name beforehandLaszlo Agocs2022-07-052-21/+1
| | | | | | | | | | | | | | | | The goal is to make it possible to implement QSGRhiSupport::backendName() in Qt Quick with just a single line: return QString::fromUtf8(QRhi::backendName(m_rhiBackend)); instead of duplicating the strings and the logic. Similarly, QBackingStoreRhiSupport can now drop its apiName() helper entirely. Change-Id: Ia8cbb1f1243539ed4d7a98e71dcc2ed56b017e40 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Avoid overflowing coverage in rasterizerAllan Sandfeld Jensen2022-06-281-11/+8
| | | | | | | | | | A single examined pixel might have sampled corners outside the logical constraints, that needs to be ignore. Pick-to: 6.4 6.3 6.2 Fixes: QTBUG-92485 Change-Id: I105fd42d3388a48f3bb03c00d640832e8e99477c Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Avoid reading outside allocated bufferAllan Sandfeld Jensen2022-06-271-0/+4
| | | | | | | | | Bound the inverse lookup result on the low end as well. Pick-to: 6.4 6.3 6.2 Fixes: QTBUG-104583 Change-Id: Id357fe1c39c88776075d737b08fc2864a2b6e829 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Enabler for fractional scaling of text in Qt QuickEskil Abrahamsen Blomfeldt2022-06-272-2/+11
| | | | | | | | | | | | | | | | | | | | | | | As opposed to the raster engine, in Qt Quick we are using unscaled positions for the glyphs and using the vertex shader to scale these after the fact. However, when picking the correct subpixel rendering for each glyph, we would use the unscaled position's fractional part, meaning that we essentially rendered the glyphs at the wrong subpixel position. This was especially visible when doing fractional scaling, e.g. 125%. Thus we need to get the fraction of the actual on-screen position instead. This has to be done both when populating the cache for the Qt Quick case (this enabler adds it as opt-in) and also when actually selecting the correct rendering of the glyph (change in Qt Declarative). Pick-to: 5.15 6.2 6.3 6.4 Task-number: QTBUG-101008 Change-Id: Ie67948b138f578b5f40d6a950c4aa92394a8f09a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Add a way to declare _exported_ logging categoriesGiuseppe D'Angelo2022-06-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a library declares a logging category that needs to be used by clients (e.g. via inline methods, macros, etc.), then the logging category function generated by Q_DECLARE_LOGGING_CATEGORY has to be exported. We've seen this problem with Q_NAMESPACE, Q_GADGET, etc.: these macros also declare functions or objects that in some cases need to be exported. And precisely like Q_NAMESPACE, Q_GADGET, etc., people end up relying on the implementation details of Q_DECLARE_LOGGING_CATEGORY (specifically, what does it expand to) in order to place the export directives in the right place. Introduce a more robust solution and apply it around qtbase. Cleanup some minor code as a drive-by (remove `extern` and useless semicolons). [ChangeLog][QtCore][QLoggingCategory] Added the Q_DECLARE_EXPORTED_LOGGING_CATEGORY macro, in order to allow dynamic libraries to declare a logging category that can be then used by client code. Change-Id: I18f40cc937cfe8277b8d62ebc824c27a0773de04 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Avoid SSE2 punningAllan Sandfeld Jensen2022-06-251-5/+6
| | | | | | | | | It is technical UB, even if GCC promises to let it work, but it also generates inefficient code. Pick-to: 6.4 Change-Id: I8f0cae3490d32287ecbaa16b1e9ace84223cda2a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Sync qt_scale_image_argb32_on_argb32_sse2 and qt_scale_image_32bitAllan Sandfeld Jensen2022-06-251-40/+16
| | | | | | | | | | The rounding was different in the SSE2 version compared to the C version. Pick-to: 6.4 6.3 6.2 Fixes: QTBUG-85109 Change-Id: I81f0a71ee5425b93da80b6a438e1778a02b9bcfa Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Add support for painting at integer DPR with downscaleMorten Sørvig2022-06-142-14/+39
| | | | | | | | | | | | | | | | | | | Enable by setting QT_WIDGETS_HIGHDPI_DOWNSCALE=1 and QT_WIDGETS_RHI=1. This will make the backing store and painter operate at the next highest integer DPR in cases where QWindow::devicePixelRatio() returns a fractional value. The backing store image will then be downscaled to the target DPR at flush time, using the RHI flush pipeline. [ChangeLog][QWidgets] Added experimental support for always painting at an integer device pixel ratio (rounding the DPR up if necessary), followed by a downscale to the target DPR.Enable by setting QT_WIDGETS_HIGHDPI_DOWNSCALE=1 and QT_WIDGETS_RHI=1. Pick-to: 6.4 Task-number: QTBUG-86344 Change-Id: Id5b834a0e3499818b0b656161f5e0c38a6caa340 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Make rhiFlush() support custom source DPRMorten Sørvig2022-06-145-17/+21
| | | | | | | | | | | | | | | | | | | | | | | The rhiFlush() implementation currently assumes that QWindow->devicePixelRatio() is the correct scale factor for transforming device independent window geometry to source geometry. However, this assumption does not hold if/when we add support for drawing to a rounded-up DPR, with a downscale later in the rhiFlush implementation. Fix this by adding a sourceDevicePixelRatio argument to rhiFlush(), which is set to either QWindow::devicePixelRatio() or QWidget::devicePixelRatio(), depending on from where it is used. Change deviceRect() and friends in qbackingstoredefualtcompositor.cpp to be scale*() functions instead which take a scale factor instead of a QWindow. Update call sites to use srouceDevicePixelRatio where that makes sense. Pick-to: 6.4 Change-Id: Idb7b1e2f36816a201e00f0defe100d2dc079cb17 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Support cosmetic brush patterns in the pdf and opengl paint enginesEirik Aavitsland2022-06-041-4/+11
| | | | | | | | | | | | | | | | | | This implements the recent functionality extension of painting cosmetic (untransformed) brush patterns, and the corresponding NonCosmeticBrushPatterns render hint, in the pdf and opengl paint engines. As part of the implementation it also fixes a couple of pre-existing bugs in the opengl engine, relating to updating the brush after changes in transformation or brush origin. As a driveby, it also includes a minor fix for the lance testing tool: request stencil buffer, as that is needed and not always provided by default. This echoes a recent fix done to tst_baseline_painting. Change-Id: Ia8811477e015eebeb40ed138bca96643ce1ab0dc Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QBrush: port from array of char[24] to qOffsetStringArray()Marc Mutz2022-06-021-2/+3
| | | | | | | | | | | | | | | | | | | | QOffsetStringArray has a more compact representation and silences warnings from GCC 12 builds with asan and ubsan sanitizers enabled: qbrush.cpp: In function ‘QDebug operator<<(QDebug, const QBrush&)’: qbrush.cpp:978:77: error: array subscript [0, 31] is outside array bounds of ‘const char [25][24]’ [-Werror=array-bounds] 978 | dbg.nospace() << "QBrush(" << b.color() << ',' << BRUSH_STYLES[b.style()] << ')'; | ~~~~~~~~~~~~~~~~~~~~~~^ qbrush.cpp:954:23: note: while referencing ‘BRUSH_STYLES’ 954 | static const char BRUSH_STYLES[][24] = { | ^~~~~~~~~~~~ cc1plus: all warnings being treated as errors Task-number: QTBUG-103923 Pick-to: 6.3 6.2 Change-Id: I5f81f516894e57b47783e2d89489a676b657fdb7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Avoid uninitialized data after getRgbF() even for invalid colorsEirik Aavitsland2022-06-011-5/+2
| | | | | | | | | | The other getXxxF() functions will fill in values in the out parameters even in case of Invalid cspec. So make getRgbF() behave consistently, and return the same values as getRedF() etc. do in that case. Change-Id: Ibb8b0c9526b43ce61118c04b479328dbe88d0419 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QRasterPaintEngine: fix GCC 12 -Werror=array-boundsMarc Mutz2022-06-011-0/+1
| | | | | | | | | | | | An enum variable can legally have values larger than the largest enumerator, so GCC isn't wrong in warning about accesses out of bounds. But we know that we don't OR enumerators of this enum together, so tell GCC, too, by using a Q_ASSUME(). Pick-to: 6.3 6.2 Task-number: QTBUG-103923 Change-Id: I3472fdb19a73a22f04df53a13f809d899613adf5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add new map methods for QColorTransformAllan Sandfeld Jensen2022-05-313-0/+58
| | | | | Change-Id: I520fc4f4bd958472c6d6359bf671835796c677fe Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Test prepared qcolortransformAllan Sandfeld Jensen2022-05-312-7/+19
| | | | | | | | | | Add test of explicitly prepared qcolortransform, this is a state a transform can get into if used for an image transform. Also cleans up the test code. Change-Id: I9445ed114bed0edc790e14024aaae6a42989220b Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Add painter render hint for brush pattern transformationEirik Aavitsland2022-05-316-14/+27
| | | | | | | | | | | | | | [ChangeLog][QtGui][QPainter] In Qt 5, the predefined brush patterns would always be transformed along with the object being painted. In Qt 6.0 onwards, they would or would not, depending on the SmoothPixmapTransformation render hint. Instead of this somewhat surprising behavior, make the default be untransformed (i.e. cosmetic), which makes sense when it comes to dpr scaling. For the cases where one wants scaling, a new render hint is introduced to enable that: NonCosmeticPatternBrushes. Change-Id: I2208c7a28af9056d7ab97a529b66bf2d502c3c4f Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Expand QColorTransformAllan Sandfeld Jensen2022-05-265-5/+88
| | | | | | | | | | Add comparison operators and an isIdentity() method to detect (1-1) transforms. [ChangeLog][QtGui] Added QColorTransform::isIdentity() method. Added QImage::colorTransformed() transitive method. Change-Id: I5fbcd14e75f2179e43e94e8c5f42cd0a5600790b Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Add test of QColorTransformAllan Sandfeld Jensen2022-05-261-1/+1
| | | | | | | | | Before it was only tested indirectly as part of the qcolorspace tests. This also fixes a rounding for maximum RGB64 values. Pick-to: 6.3 Change-Id: I6106e662c0f9d00c0b3a0c13213cb051ea39e14e Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-16142-5366/+290
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Add floating point color space conversionsAllan Sandfeld Jensen2022-05-142-8/+288
| | | | | | | | | | This allows color space conversions that produces values outside the 0.0->1.0 range, which is one of the intended functions of the floating point image formats. Change-Id: I63b37b0f6934d4382edafb4709486c785a637c67 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Remove remnants of the old Intel C++ compilerThiago Macieira2022-05-113-3/+3
| | | | | | | | | | | | | We don't support it any more. I don't think it has ever properly compiled Qt 6 (and it's no longer working for me against GCC 12's libstdc++ headers). If you report a bug against it, Intel support's first question is if you can try instead the new Clang/LLVM-based oneAPI C++ compiler. So we support only that one, which identifies itself as Q_CC_CLANG. Change-Id: I5ff8e16fcdcb4ffd9ab6fffd16eb57a092c8439e Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QPolygon: add toPolygonF()Marc Mutz2022-05-102-0/+16
| | | | | | | | | | | | | This was forgotten when implementing QTBUG-73160, but suggested in passing in QTBUG-64. [ChangeLog][QtGui][QPolygon] Added toPolygonF(). Task-number: QTBUG-73160 Task-number: QTBUG-64 Change-Id: I9b33cf47a0d432aa842ab0f8337001c66e4ca41c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Namespace a few missing Objective-C categories and their methodsMichael Spork2022-05-031-0/+5
| | | | | | | Fixes: QTBUG-100059 Pick-to: 6.2 6.3 Change-Id: I7579c9ee027de6a133a8b5d95d8e56829e089dab Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QtGui: includemocsMarc Mutz2022-04-295-0/+10
| | | | | | | | | | | Including moc files directly into their classes' TU tends to improve codegen and enables extended compiler warnings, e.g. about unused private functions or fields. Pick-to: 6.3 6.2 5.15 Task-number: QTBUG-102886 Change-Id: I1945741794c25679a9d94c0d68c8642e2c823502 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QPdfEnginePrivate: generate link only when there is a hrefDmitry Shachnev2022-04-281-1/+1
| | | | | | | | | | | Otherwise, when anchor is just something that can be linked to (not a link itself), it will result in a PDF link pointing to an empty URI. See https://github.com/retext-project/retext/issues/580. Pick-to: 6.3 Change-Id: Ib3c71797b09579783d74505601bad08c84856719 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QtGui: replace remaining uses of QLatin1String with QLatin1StringViewSona Kurazyan2022-04-283-9/+9
| | | | | | Task-number: QTBUG-98434 Change-Id: I98c27030c783f968cbf38dc966ce486dc366b302 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QtGui: use _L1 for for creating Latin-1 string literalsSona Kurazyan2022-04-285-11/+20
| | | | | | Task-number: QTBUG-98434 Change-Id: Idcb71c1d27125333a53b6bdd3e1af0d4c66617fa Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QtGui: stop using QLatin1Char constructor for creating char literalsSona Kurazyan2022-04-133-16/+16
| | | | | | | | | Required for porting away from QLatin1Char/QLatin1String in scope of QTBUG-98434. Change-Id: I308d86cefcbfd126929b68f9a853d420840c965f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Fix backingstore fractional DPR glitches for widgets in child windowsEirik Aavitsland2022-04-071-2/+12
| | | | | | | | | | | | | | For such widgets, QBackingStore::flush() takes both a region and an offset. Both must to be DPR scaled to the native backingstore coordinates. When the DPR is fractional, it can happen that the rounding of both effectively accumulate into an off-by-one error. Detect and adjust for this situation to avoid painting glitches. Task-number: QTBUG-96223 Fixes: QTBUG-102366 Pick-to: 6.3 6.2 5.15 Change-Id: I9ccd4ee54660419a1db8c27358f1419de58ae932 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Don't blit individual rects of region when when scrolling backingstoreTor Arne Vestbø2022-04-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | The QPlatformBackingStore::scroll() API takes a QRegion as input, but we have no guarantee that the individual source and destination rects of the region will not overlap each other when applying the scroll offset, so we can't naively iterate the rects and call qt_scrollRectInImage for each one. The reason this didn't cause any issues in practice was that the QWidget repaint manager was always passing in a single rect as the region. On the other hand, the client has requested a scroll of the given region, so it might assume any other part of the backing store is preserved as is. Scrolling the bounding rect of the region violates this assumption. Amends 19ef76b0606621f189d3bc56549d200f2f5ebb25. Pick-to: 6.2 6.3 Change-Id: I27934dd6685311c0b53ea2adb60fa5997e360f6c Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* QtGui: sweep Q_DECLARE_METATYPE → QT_DECL_METATYPE_EXTERN [1/2]: public APIMarc Mutz2022-04-056-7/+17
| | | | | | | | | | | | | It's one of our best tools to improve compile times. Can't backport to Qt 6.3 or 6.2 because this change introduces new exported symbols. Task-number: QTBUG-102206 Change-Id: Ib8224ed60afa893744f369fe7394d27e89b66c11 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Multithread qdrawhelper routinesAllan Sandfeld Jensen2022-04-042-475/+545
| | | | | | | | | | | | Adds multi-threading to span handling routines in qdrawhelper, effectively multi-threading almost all fills. Also increases the number of spans processed at a time to make the multithreading wider. Change-Id: Iad04e187f880666855bebcd87d668f6c6fb5db7b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Fix heap-use-after-free with rhi-based backingstoreLaszlo Agocs2022-03-291-2/+3
| | | | | | Task-number: QTBUG-102030 Change-Id: I6b05007c6ae3d653197c5680b9fc5768b0e3690f Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Short live Q_CONSTINIT!Marc Mutz2022-03-261-1/+1
| | | | | | | | | | | | | | | | | | It expands to the first available of - constinit (C++20) - [[clang::require_constant_initialization]] (Clang) - __constinit (GCC >= 10) Use it around the code (on and near static QBasicAtomic; this patch makes no attempt to find all statics in qtbase). [ChangeLog][QtCore][QtGlobal] Added macro Q_CONSTINIT. Fixes: QTBUG-100484 Change-Id: I11e0363a7acb3464476859d12ec7f94319d82be7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Avoid fetching destination when not usedAllan Sandfeld Jensen2022-03-251-21/+82
| | | | | | | | Previously this optimization would only trigger if all spans were opaque, with this change it can also trigger with singular spans. Change-Id: I79f362072ece7b6082463d32fc91000d5ff319b5 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Replace deprecated QColor::fromString in tests and documentationVolker Hilsheimer2022-03-211-2/+2
| | | | | | | | Don't use deprecated methods in tests, and don't refer to them in documentation. Change-Id: I110480742d9a7b9b0a2e194e3fe610208c1e07da Reviewed-by: Marc Mutz <marc.mutz@qt.io>