summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
Commit message (Collapse)AuthorAgeFilesLines
...
* | QtGui: mark some more types as movable/primitiveMarc Mutz2016-03-032-0/+2
| | | | | | | | | | | | | | | | | | | | | | These are already held in QVectors. Public API types need to wait until Qt 6, for BC reasons. Even though Q_RELOCATABLE_TYPE deals with most of them, we lack a way to mark a type as primitive, but still isStatic - for QList. Change-Id: I91392b01ae6f94cc847007636e12d4e64c43b2bc Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* | QtGui: Mark some more types as shared for Qt 6.Marc Mutz2016-03-032-0/+3
| | | | | | | | | | | | | | | | | | Marking them shared (which implies movable) now would make QLists of these BiC. Change-Id: If5638e8d9f43e0ad549aedf08934de31e1e189f1 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* | Avoid qMin in format conversions when possibleAllan Sandfeld Jensen2016-03-011-22/+60
| | | | | | | | | | | | | | | | Calling qMin often prevents effective vectorization, and it is only necessary when converting from formats with mixed color-channel widths. Change-Id: I2a0f3f3fb528d45be1fd025758f9d915ee1736c0 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Merge convert from routinesAllan Sandfeld Jensen2016-03-011-92/+60
| | | | | | | | | | | | | | | | These four methods do not need to be separate, the compiler can figure generate the optimal version from the template arguments. Change-Id: I45b30a9c2f2ce4da46c47f2e6e1fbd7561213c4a Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | SSSE3 optimized store of 24-bit formatsAllan Sandfeld Jensen2016-02-293-2/+61
| | | | | | | | | | | | | | | | Using shuffle and align storing our quint24 format can be done much faster. This in particular improves conversions to RGB888. Change-Id: I179748706a33a43fd6f60f5c40287317418c8867 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-02-242-1/+4
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java src/plugins/platforms/windows/qwindowsfontengine.cpp src/plugins/platforms/windows/qwindowsnativeimage.cpp tests/auto/gui/kernel/qwindow/BLACKLIST tests/auto/gui/kernel/qwindow/tst_qwindow.cpp Change-Id: I649b32b260ce0ed2d6a5089021daa0d6a8db85f7
| * Make public headers compile with -Wzero-as-null-pointer-constantMarc Mutz2016-02-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | ... or similar. This amends previous commits that converted the majority of cases. Task-number: QTBUG-45291 Change-Id: I219cdeddca7063a56efeb4fee0e5bb2cbdc7732b Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * QRasterPaintEngine::penChanged(): Assert on painter state.Friedemann Kleint2016-02-181-0/+3
| | | | | | | | | | | | | | Task-number: QTBUG-48823 Task-number: QTCREATORBUG-14888 Change-Id: I043a777da6b4e3dfdc58770fb136240a57707cb7 Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-02-187-30/+71
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also reverts commit 018e670a26ff5a61b949100ae080f5e654e7bee8. The change was introduced in 5.6. After the refactoring, 14960f52, in 5.7 branch and a merge, it is not needed any more. Conflicts: .qmake.conf src/corelib/io/qstandardpaths_mac.mm src/corelib/tools/qsharedpointer_impl.h tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp Change-Id: If4fdff0ebf2b9b5df9f9db93ea0022d5ee3da2a4
| * Merge remote-tracking branch 'origin/5.6.0' into 5.6Liang Qi2016-02-152-8/+28
| |\ | | | | | | | | | Change-Id: I0b190005377a23a91da3563428e223b8a3b18333
| | * Support arbitrary strides in the QPlatformBackingStore compositorLaszlo Agocs2016-02-051-4/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise platform backingstores providing QImages with extra pixels would break horribly. The only such platform is wayland for now. Previously the need to support this case was masked by the RGBA8888 image conversion that happened always with wayland due to its ARGB32_Pre format. With the recent improvements this is not done anymore and so the problems became apparent. Task-number: QTBUG-50894 Change-Id: I27d7a1c8e25d152ca1227af1e2c38f7d4b6acbab Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
| | * Scale offset as well on QBackingStore flushMorten Johan Sørvig2016-02-051-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also use the target window ("win") as context instead of d->window. Change-Id: I5b0fa3bb857526e4a4bc9c5e44670593da1dfe7c Task-number: QTBUG-50487 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com> Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
| | * Fix clipRect interpretation in composited backingstoresLaszlo Agocs2016-02-011-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | Empty clipRect means "clip away completely", not "no clipping". Task-number: QTBUG-50719 Change-Id: I6a9dd66130716a921fe9fc245582274e3c9718fe Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
| * | QtGui: Use QImage::constBits()/constScanLine() in non-const contexts.Friedemann Kleint2016-02-133-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | Prevent potential detaching by using constBits()/constScanLine() instead of bits()/scanLine(). Change-Id: If03f8d4d3b8ed4c07aed5eff7f580e57ca771919 Reviewed-by: Gunnar Sletta <gunnar@sletta.org> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * | QtGui: Avoid rgba64->rgba32 conversion on every pixel in gradientBłażej Szczygieł2016-02-123-15/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert rgba64 color table to a new rgb32 color table only once. Use this cache when required. This patch can 2x speed up gradient painting using 32bit color format. Task-number: QTBUG-50930 Change-Id: I9212e01e397c2e0127cdf3070cc49880a2d8df88 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | | QRegion: add move ctorMarc Mutz2016-02-132-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After this change, this was the distribution of calls in QtGui and QtWidgets when the patch was developed for 5.4: QtGui QtWidgets move 23 63 copy 23 36 Change-Id: If3f536e52fc242c585e7fa0662049c0657efcc9c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | | QtGui: eradicate Q_FOREACH loops [already const]Marc Mutz2016-02-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | (or trivially marked const) ... by replacing them with C++11 range-for loops. Change-Id: I3cce92b9d77a3ff96fad877d1d989145e530646f Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | | QMatrix, QTransform: restore nothrow move special membersMarc Mutz2016-02-114-10/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The user-defined copy assignment and (on QMatrix) copy constructors inhibit the move special member functions. We cannot do something about it in Qt 5, because these classes are exported (which they shouldn't be), and because making them trivially copyable might change how they are passed to functions by value, so we need to supply all the missing member functions manually. Change-Id: I59e480d7ba02cac7e3d654cb3345f541e0701f4c Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | | QPainter: replace an inefficient QList with QVectorMarc Mutz2016-02-113-24/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-5/+9
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | Reduce allocations by using reserve()Sérgio Martins2016-02-071-3/+5
| | | | | | | | | | | | | | | Change-Id: If34fa53402985f6b3c5e7217bce4a1177af835b6 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * | Fix rounding error in fetchTransformedBilinearAllan Sandfeld Jensen2016-02-021-2/+4
| |/ | | | | | | | | | | | | | | | | | | | | | | | | To calculate the real count we need to use the actual fixed point increment and can not use the floating point value increment wass based on since it might round differently. Includes auto-test by Gabriel de Dietrich. Task-number: QTBUG-50153 Change-Id: Ia973088f361c90370fa20bac14a4b8f373b5d234 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Replace some QList<int> with QVector<int>Marc Mutz2016-02-081-3/+3
| | | | | | | | | | | | | | | | | | On 64-bit platforms, QVector<int> uses only 50% of QList<int> per-element memory. Change-Id: I3057781e7fb58007ea2619cc91965a626d01473b Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | QColor: plaster API with Q_DECL_NOTHROWMarc Mutz2016-01-292-127/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is mostly straight-forward, but some things are worth noting: 1. Yes, this is necessary. The noexcept operator looks for noexcept tagging, not at the contents of the function to determine whether to return true. The more conditionally-noexcept functions are used, the more important it becomes that low-level classes are correctly marked noexcept. In that, it is like constexpr. 2. In accordance with the rules governing noexcept specifications for the standard library itself, the get*() functions, as well as any function taking (but not returning) channel values as ints or qreals, or taking QStrings are not marked as noexcept, since they have preconditions and thus a narrow contract. Narrow-contract functions should not be noexcept. All other functions have wide contracts (ie. no preconditions). 3. Any function returning QString can throw (bad_alloc). Consequently, they, too, are not marked nothrow. Change-Id: I023356ba1b9a4b057e613cd45380a89b222dc09d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge "Merge remote-tracking branch 'origin/5.6' into dev" into refs/staging/devLiang Qi2016-01-261-1/+1
|\ \
| * | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2016-01-261-1/+1
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java src/dbus/qdbusconnection_p.h src/dbus/qdbusintegrator.cpp src/dbus/qdbusintegrator_p.h tests/auto/corelib/io/qdir/qdir.pro tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp Change-Id: I3d3fd07aed015c74b1f545f1327aa73d5f365fcc
| | * Fix tlw source rect transformation for backingstore blit.Dyami Caliri2016-01-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The srcRect is already in device window coordinates. Converting it again via deviceRect(QRect, QWindow) causes it to be overly large. Task-number: QTBUG-50613 Change-Id: Iaae390499c0d1add842bde6eec22fb07c8de663b Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | | Fixed rendering of translucent CSS borders to prevent visible overlapBrad Stanton2016-01-261-1/+3
|/ / | | | | | | | | | | | | | | | | | | | | | | | | This fixes the rendering of translucent borders on CSS-styled widgets to prevent visible overlapping at the corners. This is done by using a miter joint (45 degree angle) if either of the adjacent edges are translucent. Previously, adjacent edges would be drawn at full length and overlap at the corners if both edges are BorderStyle_Solid and have identical QBrush objects. This works if both QBrush objects are opaque but causes visible overlap if one or both of them are translucent. Change-Id: I99d46c8634cb314e642c635439ed2f7819fcba6a Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Merge "Merge remote-tracking branch 'origin/5.6' into dev" into refs/staging/devLiang Qi2016-01-262-17/+66
|\ \
| * | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2016-01-212-17/+66
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | * Handle RGB30 formats in OpenGL backing-store integrationAllan Sandfeld Jensen2016-01-151-10/+38
| | | | | | | | | | | | | | | | | | | | | | | | Optimizes composition on platforms that may use 10-bit per color channel formats. Change-Id: Ib303c391d47795c79a4ba55d78dbb1c3c702d90a Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
| | * Optimize OpenGL binding of ARGB32PM backing storeAllan Sandfeld Jensen2016-01-142-10/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Detect premultiplied backing store and upload it without conversion and adjust blend to not multiply alpha again. Task-number: QTBUG-50381 Change-Id: I51939c4f82fbb0c48eaca6e2475bf4cf3722bc2d Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | | Add Intel copyright to files that Intel has had non-trivial contributionThiago Macieira2016-01-212-0/+2
|/ / | | | | | | | | | | | | | | | | I wrote a script to help find the files, but I reviewed the contributions manually to be sure I wasn't claiming copyright for search & replace, adding Q_DECL_NOTHROW or adding "We mean it" headers. Change-Id: I7a9e11d7b64a4cc78e24ffff142b506368fc8842 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Updated license headersJani Heikkinen2016-01-15108-1503/+2151
| | | | | | | | | | | | | | | | | | | | | | 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>
* | QPathSegments: set pathId to zero in ctorAnton Kudryavtsev2016-01-141-1/+2
| | | | | | | | | | Change-Id: Iaa4349914fbeca9c64863addb9892412e1bad65b Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Merge "Merge remote-tracking branch 'origin/5.6' into dev" into refs/staging/devSimon Hausmann2016-01-131-1/+1
|\ \
| * | Merge remote-tracking branch 'origin/5.6' into devSimon Hausmann2016-01-121-1/+1
| |\| | | | | | | | | | Change-Id: I5839bded07e23af65ced9491c4f50242f964dd31
| | * Fix a few container detachmentsSérgio Martins2016-01-101-1/+1
| | | | | | | | | | | | | | | Change-Id: I018a1fe4bdbbe42b683793d7ddbf19f464d6e3b0 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | QColor: fix misleading code in op==Marc Mutz2016-01-121-2/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For HSL colors, the (heavily over-parenthesized) code compared hslHue values mod 36000, _and also_ for equality. Of course, the second comparison is dead code. This was a cut'n'paste error from the non-HSL comparison. So, remove it. And also some of the over-parenthesization. There are no tests for operator==, and the HSL color comparison is completely opaque for me, so I'm not going to write any for this trivial change. Change-Id: I74572273730cb5cc9f427c524c268ba3f90304c1 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Merge remote-tracking branch 'origin/5.6' into devFrederik Gladhorn2016-01-083-13/+9
|\| | | | | | | | | | | Based on merge done by Liang Qi Change-Id: Id566e5b9f284d29bff2199f13f9417c660f5b26f
| * Fix offset and size for native child rtt widgetsLaszlo Agocs2016-01-071-11/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Render-to-texture widgets that are native children may have a non-zero offset telling the position within the top-level widget. The size is usually different (smaller) than the tlw's size as well. An unfortunate optimization attempt led to ignoring the size for native children with offset (0, 0). This resulted in interesting rendering artifacts whenever such widgets were placed in the top-left corner of the toplevel. This is now corrected. Task-number: QTBUG-48130 Change-Id: If449610c3f3333cb73ae149efaefd7ef42953951 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
| * Don't detach QGradientStopsSérgio Martins2016-01-051-1/+1
| | | | | | | | | | Change-Id: I1ae84d0ae825e9fb474d4fab45b0c475a3878b25 Reviewed-by: David Faure <david.faure@kdab.com>
| * Fix QPainter::rotate() documentationMitch Curtis2016-01-041-1/+1
| | | | | | | | | | Change-Id: I5d11f84181cad9be644e850c83459b47ec2f2f15 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* | Fix linux-clang build.Erik Verbruggen2015-12-191-0/+1
| | | | | | | | | | | | | | | | | | Clang's integrated assembler does not accept this assembler syntax, so tell it to only run the preprocessor, and pipe everything through the system assembler. Change-Id: I6bd884473e634837b47480546a1d1d8d62e7a2b6 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-12-184-28/+40
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/painting/painting.pri src/plugins/platforms/xcb/qxcbconnection.cpp tests/auto/corelib/thread/qthreadstorage/qthreadstorage.pro tests/auto/corelib/tools/qlocale/test/test.pro tests/auto/gui/kernel/qwindow/tst_qwindow.cpp tools/configure/environment.cpp Change-Id: I9c40f458b89b2c206de2d2c24e90b5f679c93495
| * Use Q_CONSTRUCTOR_FUNCTION instead of doing the same manuallyAllan Sandfeld Jensen2015-12-171-13/+6
| | | | | | | | | | | | | | | | Use the macro we have that does exactly what we want without the boiler plate code. Change-Id: I25c67a71f83f91f50128c8a54033ee53ad28e88a Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
| * Don't detach the color table vectorSérgio Martins2015-12-131-2/+3
| | | | | | | | | | | | Change-Id: Iec7814b0aca74ddc9744af358561b18b96d7a266 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * Remove iOS workaround for pixman drawhelpersTor Arne Vestbø2015-12-121-7/+2
| | | | | | | | | | | | Change-Id: I8636993571b04d8cda74708777ba3ef2bac09fb5 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| * iOS: Enable non-pixman NEON drawhelpers for both 32 and 64-bitTor Arne Vestbø2015-12-123-11/+13
| | | | | | | | | | | | | | | | | | | | | | | | The pixman drawhelpers are implemented using GAS syntax, which the Clang assembler doesn't handle, nor do they work on 64-bit ARM, so we disable them selectively. They are only used for 16-bit surfaces anyways, so it not a big deal on iOS. (cherry picked from commit 49568df95450733dc4c273945e5ced218132c123) Change-Id: I70848981c794739d40a6a2d9a537307bc80d61a6 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| * Fix debug operator for QRegion.Friedemann Kleint2015-12-091-6/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use QDebugStateSaver, drop the multiline format, check for null, empty and output rectangular regions as: QRegion(0,0 252x188) and complicated regions as: QRegion(size=4, bounds=(0,0 278x262) - [(0,0 278x13), (0,13 13x188), (265,13 13x188), (0,201 278x61)]) Change-Id: I82b8f58af08f7128e6cf2c2c8b06c4684fc6a9c8 Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>