summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/painting
Commit message (Collapse)AuthorAgeFilesLines
* Use QCOMPARE_GE/QCOMPARE_LEAllan Sandfeld Jensen6 hours1-31/+31
| | | | | | | It gives us more information on failures Change-Id: I1e8e32e7f6ab3bd55201f6d15efc6b60ad7db4f3 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* tst_QColorSpace::imageConversion(Adobe RGB -> Display-P3): increase toleranceTor Arne Vestbø10 hours1-1/+1
| | | | | | | | The tolerance is too low, and fails with Xcode 15 builds of Qt. Pick-to: 6.7 Change-Id: I5755d33b052a43eb4af7ea29ec54746f73e3c42c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add CMYK support to QColorSpaceAllan Sandfeld Jensen7 days3-4/+28
| | | | | | | | [ChangeLog][QtGui][QColorSpace] Support for CMYK color spaces has been added. Change-Id: I2c684dbeee8b97fc90ca4e2a892349a7fa465d06 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Make QColorTrcLut more flexibleAllan Sandfeld Jensen2024-04-051-3/+5
| | | | | | | | Make it possible to generate one way QColorTrcLut tables, and make it easier test out different table size, Change-Id: I953c68d772699de87fdddbf15ce196e6ba8b9898 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Add color space model, making gray color spaces explicitAllan Sandfeld Jensen2024-04-051-1/+171
| | | | | | | | | This also adds image conversion of both format and color space, which will also be required later for conversions to CMYK formats and color spaces. Change-Id: I578c0a010ffcdb4df4cf9080c0621fac8bc342bf Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Port QImage::Format_CMYK32 to CMYK8888Giuseppe D'Angelo2024-04-041-3/+3
| | | | | | | | | | | | Follow the established convention that byte-oriented image formats have the "8888" suffix, not "32". The old enum name is temporarily left to help port other submodules. This work has been kindly sponsored by the QGIS project (https://qgis.org/). Change-Id: I4b6f10cb22312b614cb9cf4b0ac439907276c538 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* GUI: add CMYK painting supportGiuseppe D'Angelo2024-04-031-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds a CMYK 8bpp format to QImage. The idea is to enable the transport of CMYK images inside Qt, for instance to be loaded/saved from files or painted on CMYK capable paint devices (e.g. PDF). Also, rasterization support *from* a CMYK image is added (on top of a RGB surface), as well as CMYK image scaling/conversion. Conversion and rasterization between CMYK and RGB isn't particularly optimized nor it honors any colorspaces yet. The overall idea is to match 1:1 the existing behavior of CMYK QColor (which get naively changed to RGB; there isn't colorspace support in QPainter yet). There are no plans to add rasterization *towards* CMYK. Image save/load in native CMYK formats will be added in future commits. This work has been kindly sponsored by the QGIS project (https://qgis.org/). [ChangeLog][QtGui] Support for 8-bit CMYK images has been added. Change-Id: I4b024cd4c15119c669b6ddd450418a9e425587f8 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Tests: check the output of QFile::openGiuseppe D'Angelo2024-03-271-4/+4
| | | | | | | | | | Wrap the call in QVERIFY. tst_QTextStream::read0d0d0a was also faulty as it *never* opened the file because of a broken path. Fix it with QFINDTESTDATA. Change-Id: I61a8f83beddf098d37fda13cb3bfb4aaa4913fc5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add QColorSpace::isValidTargetAllan Sandfeld Jensen2024-03-271-1/+1
| | | | | | | | To indicate color spaces that can not be used as a target, but only as a source. Change-Id: Iae79e3533599c112872d171a2f45178029be89dc Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Add A2B tables, and PCSLab support to QIccAllan Sandfeld Jensen2024-03-073-0/+88
| | | | | | | | | | | | | This finishes off ICC color space support in Qt (short of the optional multi process elements), and includes necessary parts for potential CMYK support (PCSLab and A2B support) [ChangeLog][QColorSpace] ICC profiles that are not three-component matrix based are now supported. Task-number: QTBUG-108175 Change-Id: Ie29b17a366d9ba0ea8135e1752530d6bb19e7520 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QPainterPath: detach and reset before streaming inThiago Macieira2024-02-271-0/+15
| | | | | | | | | | Otherwise we end up appending and modifying the shared object. Pick-to: 5.15 6.5 6.6 6.7 Task-number: QTBUG-122704 Change-Id: I01ec3c774d9943adb903fffd17b692c2e6d53e97 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix build without PDFAxel Spoerl2024-02-251-1/+3
| | | | | | | | | | | | tst_baseline_painting and tst_qpdfwriter rely on QT_FEATURE_pdf being enabled, without making it a condition to build the tests. Don't build the tests with PDF disabled. Task-number: QTBUG-122137 Pick-to: 6.7 6.6 6.5 Change-Id: Idbf03f30557618c83e946a80b7759cd4f6978ad5 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QPainter: fix assert when drawing bitmaps at very near to .5 coordEirik Aavitsland2024-02-201-0/+11
| | | | | | | | | | | | | | The code assumed that the rounding of a floating point value, and the rounding of the sum of that value and an integer, would always snap in the same direction. But because of accuracy limits (independently of the rounding function employed), that is not always the case for fractions very near to .5. Fixes: QTBUG-122451 Pick-to: 6.7 6.6 6.5 6.2 5.15 Change-Id: I0825d42e6be7f6e3397760a5e9be5dddca42dcdc Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Fix build with gcc-14Allan Sandfeld Jensen2024-02-141-4/+4
| | | | | | | | | | Work-around SiC change made to qfloat16 when using native floats. Pick-to: 6.7 6.6 6.5 Change-Id: I981505e6eff7277ad14512b56fad334be6e79016 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove extra semi-colonsTasuku Suzuki2024-02-062-4/+4
| | | | | Change-Id: I92fddb36cd136fd1bd627955f15d0559b9942d7e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Change license for tests filesLucie Gérard2024-02-0421-21/+21
| | | | | | | | | | | | According to QUIP-18 [1], all tests file should be LicenseRef-Qt-Commercial OR GPL-3.0-only [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: I9657df5d660820e56c96d511ea49d321c54682e8 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* QPainterPath: Fix boundingRect and controlPointRect ignoring start pointNoah Davis2024-01-301-0/+28
| | | | | | | | | | | | | | | | | | | | | | The boundingRect and controlPointRect did not use the start point from the `QPainterPath(const QPointF &startPoint)` constructor until the `dirtyBounds` or `dirtyControlBounds` member variables were set to true. Those two are false on construction. This bug was fixed by adding a new constructor for QPainterPathPrivate that initializes the `elements`, `bounds` and `controlBounds` member variables with the start point from the constructor. There is also an autotest to verify that the top left of the boundingRect and controlPointRect are at the same position as elementAt(0) when the start point constructor is used. [ChangeLog][QtGui][QPainterPath] boundingRect() and controlPointRect() now use the start point from QPainterPath(const QPointF &startPoint). Pick-to: 6.7 6.6 6.5 Change-Id: I7bf30364406c14ed60f75d24b78a9a5535f75d93 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QRadialGradient: Fix undefined behaviorHatem ElKharashy2024-01-081-0/+16
| | | | | | | | | | | | The UBSan raises a division by zero in getRadialGradientValues. This can be avoided by calculating the inverse in qt_fetch_radial_gradient_template as a checker is done to avoid division by zero there. (Credit to OSS-Fuzz) Pick-to: 6.7 Fixes: QTBUG-120332 Change-Id: I798d1efc87ee07df7ca6f401aa476013cdbffe42 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* pagelayout: Fix inaccuracy in marginsPixels and paintRectPixelsJarkko Koivikko2023-12-091-0/+72
| | | | | | | | | | | | | | | | | | | Do not use rounded value for conversion, which gives inaccurate result. Example case: typical margin for A4 paper size is 8.4 pt. At 600 dpi, the old code was using rounded point value of 8, which produces an incorrect result: 8 / (72.0 / 600) = 67 pixels The correct margin is of course: 8.4 / (72.0 / 600) = 70 pixels Pick-to: 6.6 Change-Id: I44b2eeabb82fd3bf8e2dcfcba66ae96cde763875 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* pagesize: Fix pixel overflow in QPageSize::sizePixels and rectPixelsJarkko Koivikko2023-12-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | This update addresses an issue in converting page size from points to device pixels. Previously, rounding the result could lead to an overflow beyond the physical pixel capacity. Example case: A4 paper size at 600 dpi: - points to pixels: 842 pt / (72.0 / 600) = 7016.666666666667 However, the physical pixel height for an HP printer: - GetDeviceCaps(hdc, PHYSICALHEIGHT)) = 7016 This fix prevents pixel size from exceeding the physical print area, avoiding unprinted pixels. Pick-to: 6.6 Change-Id: I66eabc628d3374d9cfb19b0eb5928f83afbc13dc Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Faure <david.faure@kdab.com>
* print: QPageLayout: Fix pt unit conversionJarkko Koivikko2023-12-091-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch corrects the miscalculation in point unit conversion, ensuring correct margin updates. Previously, non-pt units were rounded to two decimal places. When converting back to pt, rounding was to zero decimals, making the result always less than the original. This could result in margins falling below the minimum allowed. Example: original_points = 8.4 multiplier = 2.83464566929 mm: qRound(8.4 / multiplier * 100) / 100 = 2.96 new_points: qRound(2.96 * multiplier) = 8 // wrong! The fix rounds back-converted values up to two decimals, ensuring they are never less than the original and thus stay above minimum margins. new_points: qCeil(2.96 * multiplier * 100) / 100 = 8.4 Also, remove unused function qt_convertPoint. Pick-to: 6.6 Change-Id: I6109f8d381aec96db1ce04cc167f7b73c1c0b9a8 Reviewed-by: David Faure <david.faure@kdab.com>
* tests/auto/*: port Q_FOREACH to ranged-for, make container constAhmad Samir2023-08-191-27/+25
| | | | | | | | | | | | | Use std::initializer_list/std::array for data known at compile time. In files where Q_FOREACH isn't used any more, remove "#undef QT_NO_FOREACH". Drive-by change: de-duplicate some trivial code. Task-number: QTBUG-115839 Change-Id: Ifb1a93579bd4ab8fd10f78665a28559cc61da7e2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* tests/auto/: port Q_FOREACH to ranged-for, local const containersAhmad Samir2023-08-191-2/+2
| | | | | | | | | | | | | | | | | | | | These are local containers that are either: - Already const and didn't need Q_FOREACH to begin with - Can be simply made const, just by adding const keyword In one case the unittest checked that the container's size is 1, so use list.first() instead of a for-loop. In files where Q_FOREACH isn't used any more, remove "#undef QT_NO_FOREACH". Also remove those files from NO_PCH_SOURCES. Drive-by changes: - Remove parenthesis from one-line for-loops - Make the for-loop variable a const& where a copy isn't needed Task-number: QTBUG-115839 Change-Id: Ide34122b9cda798b80c4ca9d2d5af76024bc7a92 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Mark all of Qt as free of Q_FOREACH, except where it isn'tMarc Mutz2023-08-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | The density of Q_FOREACH uses in this and some other modules is still extremely high, too high for anyone to tackle in a short amount of time. Even if they're not concentrated in just a few TUs, we need to make progress on a global QT_NO_FOREACH default, so grab the nettle and stick to our strategy: Mark the whole of Qt with QT_NO_FOREACH, to prevent new uses from creeping in, and whitelist the affected TUs by #undef'ing QT_NO_FOREACH locally, at the top of each file. For TUs that are part of a larger executable, this requires these files to be compiled separately, so add them to NO_PCH_SOURCES (which implies NO_UNITY_BUILD_SOURCES, too). In tst_qglobal.cpp and tst_qcollections.cpp change the comment on the #undef QT_NO_FOREACH to indicate that these actually test the macro. Task-number: QTBUG-115839 Change-Id: Iecc444eb7d43d7e4d037f6e155abe0e14a00a5d6 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Increase setup precision and reduce test precisionAllan Sandfeld Jensen2023-08-171-4/+6
| | | | | | | | | | | Reduce test precision to account for rounding errors, and at the same time increase the setup precession by premultiplying in rgba64 instead of argb32, which makes the test randomness trigger more regularly. Pick-to: 6.6 Task-number: QTBUG-115945 Change-Id: I3e95449ada26ff5bb0acc00412f345733603f4c0 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* CMake: Make gui tests standalone projectsAlexandru Croitor2023-07-0517-0/+102
| | | | | | | | | | | | | | | | | Add the boilerplate standalone test prelude to each test, so that they can be opened with an IDE without the qt-cmake-standalone-test script, but directly with qt-cmake or cmake. Boilerplate was added using the following scripts: https://git.qt.io/alcroito/cmake_refactor Manual adjustments were made where the code was inserted in the wrong location. Task-number: QTBUG-93020 Change-Id: I2ef59684cf297a0222a136ce7b5630037294d000 Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Port QPathClipper test away from home-grown QCOMPAREVolker Hilsheimer2023-03-051-9/+13
| | | | | | | | Use a scope guard to print debug info in case of an early return. Silences clang warning about sprintf being unsafe and deprecated. Change-Id: Idcbfde1a6f2eb1143f51c1e5ecedbf3fe90d8ec8 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* tests: Remove remains of qmake conversion from CMakeLists.txt filesFriedemann Kleint2023-02-1717-38/+2
| | | | | | | Pick-to: 6.5 Change-Id: I8d106554bb86ac1ec9bb7a4083de4c376bcbab1d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Use SPDX license identifiersLucie Gérard2022-11-151-27/+2
| | | | | | | | | Amends commit 05fc3aef53348fb58be6308076e000825b704e58. Some files were still missing. Task-number: QTBUG-67283 Change-Id: I78b3cbf31138192805b7e186337c6fda4ac844aa Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Port from container::count() and length() to size() - V5Marc Mutz2022-11-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8, but extended to handle typedefs and accesses through pointers, too: const std::string o = "object"; auto hasTypeIgnoringPointer = [](auto type) { return anyOf(hasType(type), hasType(pointsTo(type))); }; auto derivedFromAnyOfClasses = [&](ArrayRef<StringRef> classes) { auto exprOfDeclaredType = [&](auto decl) { return expr(hasTypeIgnoringPointer(hasUnqualifiedDesugaredType(recordType(hasDeclaration(decl))))).bind(o); }; return exprOfDeclaredType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes)))); }; auto renameMethod = [&] (ArrayRef<StringRef> classes, StringRef from, StringRef to) { return makeRule(cxxMemberCallExpr(on(derivedFromAnyOfClasses(classes)), callee(cxxMethodDecl(hasName(from), parameterCountIs(0)))), changeTo(cat(access(o, cat(to)), "()")), cat("use '", to, "' instead of '", from, "'")); }; renameMethod(<classes>, "count", "size"); renameMethod(<classes>, "length", "size"); except that the on() matcher has been replaced by one that doesn't ignoreParens(). a.k.a qt-port-to-std-compatible-api V5 with config Scope: 'Container'. Added two NOLINTNEXTLINEs in tst_qbitarray and tst_qcontiguouscache, to avoid porting calls that explicitly test count(). Change-Id: Icfb8808c2ff4a30187e9935a51cad26987451c22 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* tst_QPainter::blendARGBonRGB(): rename some data rowsEdward Welbourne2022-10-181-8/+8
| | | | | | | Avoid duplication by distinguishing similar test-cases. Change-Id: I1a100d6c9729f0ea356f177535d15c3d36e2da9e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* tst_QPainterPath::testNaNandInfinites(): anticipate the warningsEdward Welbourne2022-10-181-3/+30
| | | | | | | | | | | | The test used to trigger a lot of QWARN messages; these are clearly intended, so tell QTest to expect them, so that we get an error here if those warnings ever don't show up. Incidentally tidy up a comment and convert a != verify to a QCOMPARE_NE(), since it's now available to do that job. Change-Id: I83e225c37abe8446dac06ebe4e75258cb87b71b0 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* tst_QPainterPath::testArcMoveTo(): include index in some data tagsEdward Welbourne2022-10-181-8/+8
| | | | | | | | | | | | In the process, clean up the building of the data tags: use a range-for loop, albeit we do need an index to show in tags; show it and the angle in the tags using addRow()'s easier formatting. Change the low angle tests to show the sign of the angle (which is how they differ)rather than just labeling them 1 and 2. Change-Id: Ib5aaa3e22d771c530c9343ba368b0fdfceb264ce Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Jason McDonald <macadder1@gmail.com>
* tst_QPainterPath::contains_QRectF(): rename some data rowsEdward Welbourne2022-10-181-3/+3
| | | | | | | | | | The last three duplicated earlier ones; and their names didn't take into account the circle that had been added to the path since those tests. So revise their names to reflect that. Change-Id: I32d74f21947b4ba0c04eee53daf8efde6b4a6409 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-111-2/+2
| | | | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace, with manual unstaging of the actual definition and documentation in dist/, src/corelib/doc/ and src/corelib/global/. Task-number: QTBUG-99313 Change-Id: I4c7114444a325ad4e62d0fcbfd347d2bbfb21541 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Port from container.count()/length() to size()Marc Mutz2022-10-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is semantic patch using ClangTidyTransformator: auto QtContainerClass = expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o) makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container'. <classes> are: // sequential: "QByteArray", "QList", "QQueue", "QStack", "QString", "QVarLengthArray", "QVector", // associative: "QHash", "QMultiHash", "QMap", "QMultiMap", "QSet", // Qt has no QMultiSet Change-Id: Ibe8837be96e8d30d1846881ecd65180c1bc459af Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix flaky FP32x4 testAllan Sandfeld Jensen2022-09-161-0/+1
| | | | | | | | | | | The composition implementation may act unexpectedly on Inf or NaN input values. This change avoid those values, without changing the current implementation. Pick-to: 6.4 Fixes: QTBUG-101236 Change-Id: I8e4ee67f53093b7f81e014b28d8a028ba2ddcc47 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-08-2318-18/+18
| | | | | | | Task-number: QTBUG-105718 Change-Id: I5d3ef70a31235868b9be6cb479b7621bf2a8ba39 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Add license headers to cmake filesLucie Gérard2022-08-0318-0/+54
| | | | | | | | | | | | CMakeLists.txt and .cmake files of significant size (more than 2 lines according to our check in tst_license.pl) now have the copyright and license header. Existing copyright statements remain intact Task-number: QTBUG-88621 Change-Id: I3b98cdc55ead806ec81ce09af9271f9b95af97fa Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* CMake: Don't use PUBLIC_LIBRARIES for tests and test helpersAlexandru Croitor2022-07-2817-21/+21
| | | | | Change-Id: I9b7404e1d3a78fe0726ec0f5ce1461f6c209e90d Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* unblacklist passing tests 2022Anna Wojciechowska2022-06-231-2/+0
| | | | | Change-Id: Ifb09a997d39fc2c92503e77cf372d443c13c4c2b Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
* Add new map methods for QColorTransformAllan Sandfeld Jensen2022-05-311-0/+93
| | | | | Change-Id: I520fc4f4bd958472c6d6359bf671835796c677fe Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Test prepared qcolortransformAllan Sandfeld Jensen2022-05-312-17/+90
| | | | | | | | | | 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>
* Expand QColorTransformAllan Sandfeld Jensen2022-05-261-17/+31
| | | | | | | | | | 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-263-0/+237
| | | | | | | | | 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>
* tst_qpainter: change the FP exception block-list to a pass-listThiago Macieira2022-05-241-1/+8
| | | | | | | | | | | | | | | | We should prefer to test this unless we know it won't work, but this is very hardware and implementation-dependent anyway. So I declare that we'll only guarantee FP exception cleanliness on a best-effort basis for a few platforms. The notable difference in this commit is the removal of QNX. I don't know why it began producing an FP exception with one of my changes, but since the toolchain isn't public, I can't debug and will not devote any time to figuring it out. If users of QNX require this, then someone with interest in that OS will need to spend time after my changes integrate. Change-Id: Ibcde9b9795ad42ac9978fffd16f1cb9c03a0ff66 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-1620-540/+40
| | | | | | | | | | | | | 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-141-0/+51
| | | | | | | | | | 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>
* QPolygon: add toPolygonF()Marc Mutz2022-05-101-0/+12
| | | | | | | | | | | | | 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>
* QColor: deprecate isValidColor, setNamedColor, string-ish ctorsMarc Mutz2022-03-151-0/+23
| | | | | | | | | | | | [ChangeLog][QtGui][QColor] The constructors from string-ish type, as well as the setNamedColor() and isValidColor() functions, have been deprecated effective Qt 6.6 in favor of fromString() and isValidColorName(), resp. Fixes: QTBUG-101389 Change-Id: I002646bd48c1e4340dc6842fd136fc9f35bb9b61 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>