summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qdrawhelper.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Disable RGB64 backend for ARGB32 when it will be very slowAllan Sandfeld Jensen2018-09-141-0/+2
| | | | | | | | | | | Fixes a speed regression on ARGB32 painting on low end hardware introduced when it was switched to using the RGB64 raster routines. It turns out several of our embedded QPA targets use ARGB32 as native format. Task-number: QTBUG-69724 Change-Id: I6d7993c12da46a85b8354eb905930dae9602b5e6 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Avoid conversion over RGBA64 for RGB32 LCD text blendingAllan Sandfeld Jensen2018-08-301-9/+49
| | | | | | | | Short-cuts the case where there is no gamma correction to avoid a conversion over RGBA64 and back. Change-Id: I100697a9f7a4b94283557b2c0eaa45e0eff81785 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add missing optimization for loading RGB32 to RGBA64 using NEONAllan Sandfeld Jensen2018-08-031-0/+61
| | | | | | | | | | The rest of the RGB64 routines were optimized, but the loading of RGB32 was not as it was originally not used much, but with ARGB32 using the RGB64 backend, it is essential for decent performance. Task-number: QTBUG-69724 Change-Id: I1c02411ed29d3d993427afde44dfa83689d117e0 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Reduce recent performance regressionAllan Sandfeld Jensen2018-05-301-2/+2
| | | | | | | | | | | | | | The change to fix 16-bit integer overflow used two floor operations when only one is necessary. With floor being rather expensive on x86 without SSE4.1 this caused a performance regression in ARGB32 smooth perspective transforms. This eliminates one of the floor operations which is unnecessary as the number is always positive in this case and thus truncation will yield the same result faster. Change-Id: Iaae76820d4bc2f368e49ed143130b5075fc760a2 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Fix potential 16-bit integer overflowAllan Sandfeld Jensen2018-05-231-4/+4
| | | | | | | | | | | When multiplying a float in [0;1[ with (1<<16), with rounding, it might end up being rounded to 65536 even if the input was under 1. This patch uses a floor operation to make sure the value can be in a ushort, and cleans up the surrounding code so it is clearer what it does. Task-number: QTBUG-68360 Change-Id: I2d566586765db3d68e8e7e5fb2fd1df20dabd922 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Remove last uses of interpolate_4_pixels_16 on SSE2 and NEONAllan Sandfeld Jensen2018-04-111-53/+43
| | | | | | | | | | | | With SSE2 or NEON interpolate_4_pixels is faster than interpolate_4_pixels_16, and using it saves a branch of duplicated code. Similar changes had already been done other places it was used, those have been updated to follow a similar logic. Change-Id: I040d96480f7f925f659602f66f931d28b59312a5 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Fix performance regression in simple a8 non-gamma correctedAllan Sandfeld Jensen2018-03-141-0/+2
| | | | | | | Avoid doing the conversion over QRgba64 when we don't need it. Change-Id: Ic2f82bef0a80b17ef7803eedcdb0600eeac96489 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Unalias some core drawhelper loopsAllan Sandfeld Jensen2018-02-061-58/+54
| | | | | | | | | | Some compilers will assume src and buffer are different and only vectorize the unaliased case and take a slow path when they are equal. In our case they are as often equal, so we need to manually unalias the variables to make sure both cases are fully optimized. Change-Id: I6ec86171dd179844facdf45376253c55980d9e36 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add AVX2 optimized versions of the most basic RGB64 compositionsAllan Sandfeld Jensen2018-01-041-2/+9
| | | | | | | Speeds up RGB30 and ARGB32-unpremul painting. Change-Id: I419afdf5c26ceffc0f7557b8f196035056178c9a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.10' into devLars Knoll2018-01-021-4/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf sc/corelib/io/qfsfileengine_p.h src/corelib/io/qstorageinfo_unix.cpp src/platformsupport/eglconvenience/qeglpbuffer_p.h src/platformsupport/input/libinput/qlibinputkeyboard.cpp src/platformsupport/input/libinput/qlibinputpointer.cpp src/plugins/platforms/cocoa/qcocoamenu.mm src/plugins/platforms/ios/qiosscreen.h src/plugins/platforms/ios/qioswindow.h src/plugins/platforms/ios/quiview.mm src/printsupport/dialogs/qpagesetupdialog_unix_p.h src/printsupport/dialogs/qprintpreviewdialog.cpp src/printsupport/widgets/qcupsjobwidget_p.h src/widgets/widgets/qmenu.cpp tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp Change-Id: Iecb4883122efe97ef0ed850271e6c51bab568e9c
| * Mask potentially undefined alpha in blend_transformed_argbAllan Sandfeld Jensen2017-12-161-2/+3
| | | | | | | | | | | | | | | | Makes sure the ARGB32PM that is painted on always have a defined alpha. Task-number: QTBUG-55645 Change-Id: Ifcf5fcc2127d255518eca4763845a197da6c7914 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * Improve readability of code that uses the Qt signed size typev5.10.0-rc2Simon Hausmann2017-11-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During the container BoF session at the Qt Contributor Summit 2017 the name of the signed size type became a subject of discussion in the context of readability of code using this type and the intention of using it for all length, size and count properties throughout the entire framework in future versions of Qt. This change proposes qsizetype as new name for qssize_t to emphasize the readability of code over POSIX compatibility, the former being potentially more relevant than the latter to the majority of users of Qt. Change-Id: Idb99cb4a8782703c054fa463a9e5af23a918e7f3 Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch> Reviewed-by: David Faure <david.faure@kdab.com>
* | Expand ARGB32ToARGB32PM to also work on 32-bit ARM neonAllan Sandfeld Jensen2017-11-081-1/+1
|/ | | | | | | | Replaced two AArch64 specific instructions with 2-3 instruction replacements from ARM32. Change-Id: I5cbbda5afdaabea52babaaf8e5cc57262d897159 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-10-161-0/+4
|\ | | | | | | Change-Id: I3cf73c53cf131d0babfb558c2507bed0e0fc5f08
| * Fix crash with clips entirely outside glyph mapAllan Sandfeld Jensen2017-09-261-0/+4
| | | | | | | | | | | | | | | | When the range to work on is empty just continue to next span. Task-number: QTBUG-63412 Change-Id: Ic5cb77ed438eb9c218f482095aa0cd4e3c2fc6e6 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-08-311-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/examples.pro qmake/library/qmakebuiltins.cpp src/corelib/global/qglobal.cpp Re-apply b525ec2 to qrandom.cpp(code movement in 030782e) src/corelib/global/qnamespace.qdoc src/corelib/global/qrandom.cpp src/gui/kernel/qwindow.cpp Re-apply a3d59c7 to QWindowPrivate::setVisible() (code movement in d7a9e08) src/network/ssl/qsslkey_openssl.cpp src/plugins/platforms/android/androidjniinput.cpp src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/widgets/widgets/qmenu.cpp tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp Change-Id: If7ab427804408877a93cbe02079fca58e568bfd3
| * Avoid assert on large clips in qt_alphamapblit_genericAllan Sandfeld Jensen2017-08-291-2/+2
| | | | | | | | | | | | | | | | | | It is (end - start) that represent the number of pixels being worked on and needs to be smaller than the buffer size. Change-Id: I75a22bc2656ac1c7d231278c3a1931758090f8ce Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | Fix handling of mirroring upscaling in simple bilinear upscalerAllan Sandfeld Jensen2017-08-101-21/+30
| | | | | | | | | | | | | | | | | | | | Calculates the correct offsets and coordinate transforms for the intermediate buffer. This means we can conceptually simplify our path switches instead of having downscale routines handling mirrored upscaling. Change-Id: I60efa7feaba80165672ca0ce064515fdf620869d Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devThiago Macieira2017-08-081-9/+12
|\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/widgets/kernel/qwidget.cpp This merge also extends the expected output of the pairdiagnostics teamcity output (added in dev in commit c608ffc56ab37f9a9d5b9c34543126adb89e2b08) after the recent addition of the flowId attribute to the teamcity output (commit 8f036562119dd35ce51dc9230304d893b906bd37 in 5.9). Change-Id: I3868166e5efc45538544fffd14d8aba438f9173c
| * Fix RGBA64 interpolation when x remainder equals zeroAllan Sandfeld Jensen2017-08-021-9/+12
| | | | | | | | | | | | | | | | | | | | The 16-bit multiplication can not handle the case where one of the numbers is 65536, so skip it in that case as we do when the y remainder triggers the same issue. Task-number: QTBUG-62165 Change-Id: Iea2ebe557949797d9aa77b8d7cdac9247eea7b84 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devGabriel de Dietrich2017-07-131-4/+4
|\| | | | | | | | | | | | | Conflicts: src/widgets/widgets/qmainwindowlayout.cpp Change-Id: I306b4f5ad11bceb336c9091241b468d455fe6bb6
| * Fix buffer overflow in text blendingAllan Sandfeld Jensen2017-07-111-4/+4
| | | | | | | | | | | | | | | | | | Clip buffers being converted to those being worked on so we don't write outside the lines. Task-number: QTBUG-61863 Change-Id: Icc7c6c0946fa522b5afeca0663fc2b45151b1897 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | Allow QImage with more than 2GByte of image dataAllan Sandfeld Jensen2017-07-081-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | Changes internal data-size and pointer calculations to qssize_t. Adds new sizeInBytes() accessor to read byte size, and marks the old one deprecated. Task-number: QTBUG-50912 Change-Id: Idf0c2010542b0ec1c9abef8afd02d6db07f43e6d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-07-041-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qprocess_unix.cpp src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbwindow.cpp src/widgets/util/util.pri tests/auto/corelib/thread/qthread/qthread.pro tests/auto/corelib/thread/qthread/tst_qthread.cpp Change-Id: I5c45ab54d46d3c75a5c6c116777ebf5bc47a871b
| * Fix GCC 8 warnings about ignored const on cast result typesMarc Mutz2017-06-281-1/+1
| | | | | | | | | | | | | | | | | | | | qdrawhelper.cpp:1365:25: error: type qualifiers ignored on cast result type [-Werror=ignored-qualifiers] for (; i < count && (const uintptr_t)buffer & 0xF; ++i) { ^~~~~~~~~~~~~~~~~~~~~~~ etc... Change-Id: I702f9aada24ad49ebc7ede0a04e5afc1b0164e30 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge "Merge remote-tracking branch 'origin/5.9' into dev" into refs/staging/devLiang Qi2017-06-071-1/+1
|\ \
| * | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-06-071-1/+1
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/widgets/widgets/qmenu.cpp Change-Id: I6d3baf56eb24501cddb129a3cb6b958ccc25a308
| | * Fix semi-opaque linear gradient on ARGB32Allan Sandfeld Jensen2017-06-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The qt_gradient_argb32 routine optimizes linear gradients with the solid blend routines that is ARGB32PM only. If the gradient is not solid, it will not get unpremultipled on write like it should for ARGB32. Covered by lancelot, but the change is less than 5%. Change-Id: Id99f2fa125cc091f3b5b29ec2d06618785d628fa Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | | Implement remaining porter-duff compositions for rgb64Allan Sandfeld Jensen2017-06-071-4/+7
|/ / | | | | | | | | | | | | | | | | Gets rid of debug output when they are used, which is more common now that we use it for unpremultiplied ARGB32. Task-number: QTBUG-60549 Change-Id: I14b2eb34d1d08612916e2b69b188f33dbe1b525c Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | Merge "Merge remote-tracking branch 'origin/5.9' into dev" into refs/staging/devLiang Qi2017-05-301-37/+29
|\ \
| * | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-05-291-37/+29
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf mkspecs/common/msvc-desktop.conf mkspecs/win32-g++/qmake.conf mkspecs/win32-icc/qmake.conf src/platformsupport/fontdatabases/mac/coretext.pri src/plugins/platforms/cocoa/qcocoawindow.h src/plugins/platforms/cocoa/qcocoawindow.mm Change-Id: I74a6f7705c9547ed8bbac7260eb4645543e32655
| | * Revert gamma-corrected handling of transparent destination bufferAllan Sandfeld Jensen2017-05-081-37/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to the text blend routines being used by ARGB32 and due to another bug on invalid premultiplied buffers, we need to keep using the naive blend on non-opaque pixels for now. Task-number: QTBUG-60562 Task-number: QTBUG-60571 Change-Id: Idfbb2c2e24dd840189c4fbed4e167f03bbc6ca8d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | | Claim alpha8 is premultipliedAllan Sandfeld Jensen2017-05-291-1/+1
|/ / | | | | | | | | | | | | | | | | | | The image format alpha8 is neither premultiplied nor non-premultiplied, but premultiplied being the default, it is better to claim that to avoid it trigging any special handling of unpremultiplied semi- transparent formats. Change-Id: I4af28bca472cd97ab6867bf12c4a202005577bb4 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-05-071-92/+57
|\| | | | | | | | | | | | | | | Conflicts: src/network/access/qnetworkreply.cpp tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp Change-Id: Iadf766269454087e69fb216fc3857d85b0ddfaad
| * Cleanup rgb32 text-blending code pathAllan Sandfeld Jensen2017-05-021-92/+57
| | | | | | | | | | | | | | | | | | | | | | | | Cleans up the rgb32 text-blending functions, so they now follow the new pattern used in the new generic text-blending functions. This also means they can now handle gamma-corrected blending on top of transparent destination pixels instead of falling back to naive blending. Task-number: QTBUG-60469 Change-Id: I154ba513ff99c0cefab8fa12f4ed43fcd6563a6a Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-04-041-8/+8
|\| | | | | | | | | | | | | | | Conflicts: src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h src/plugins/platforms/xcb/qxcbwindow.cpp Change-Id: Ic747c3c50e68c005b425e7a1ec2a90965527c8bd
| * Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-03-281-8/+8
| |\ | | | | | | | | | Change-Id: I4788bc037c55c48563ffd4ba9633a22aa1d12f22
| | * Annotate more implicit fallthroughsAllan Sandfeld Jensen2017-03-271-8/+8
| | | | | | | | | | | | | | | | | | | | | Reduces our number of gcc 7 warnings Change-Id: I792d658cbc11cad15cf45da3a36fc93fcdcc67ea Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | Split fetchTransformedBilinear and fetchTransformedBilinear64Allan Sandfeld Jensen2017-03-191-356/+289
|/ / | | | | | | | | | | | | Split out basic fetching to share it between the two. Change-Id: I6c27a7cea3a5c10b511232edc68bd32490514a27 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | Avoid QRgba64 arrays in the generic text-rendering routinesAllan Sandfeld Jensen2017-03-081-8/+8
| | | | | | | | | | | | | | | | Like in other functions, allocate arrays of quint64 instead of QRgba64 to avoid the cost of initializing large arrays on every small scanline. Change-Id: Ie132b3157003a18a444ca5c4f94ae668d17327fd Reviewed-by: Gunnar Sletta <gunnar@crimson.no>
* | Add AVX2 optimized bilinear texture transformAllan Sandfeld Jensen2017-02-281-0/+11
| | | | | | | | | | | | | | | | Implement AVX2 versions of the three optimized paths of bilinear texture transform. Change-Id: Ie7199ef7dcce1e3457535fee35822d76afc0e8ba Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Fix wrong access to qMemRotateFunctionsAllan Sandfeld Jensen2017-02-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | Since this table was restructured in 7c401397a4 and changed to being indexed bitwidth and not format, NEON-enabled builds have been writing to an undefined place after the table. Discovered by compiler warnings on CI. Change-Id: I109cd19a8dd703bdafdf13afd3f96ebeaa0e6de5 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* | Don't fetch destination in RGB64 mode when not necessaryAllan Sandfeld Jensen2017-02-161-20/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | Extends the short-cut of not fetching destination to also apply to the RGB64 painting. This saves reading and converting destination pixels when they will be fully replaced with source pixels. Since ARGB32 was switched to using the RGB64 drawhelpers, and ARGB32 is particularly expensive to read, this change is important to avoid performance regression. Change-Id: If3a2439140d6364e8429783cfa786bd000cfab45 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-02-081-50/+44
|\| | | | | | | | | | | | | | | Conflicts: configure.json mkspecs/win32-icc/qmake.conf Change-Id: Ibf40546b024d644c7d9ed490bee15b82597f4d3f
| * Fix MIPS DSP configurationAllan Sandfeld Jensen2017-01-271-50/+44
| | | | | | | | | | | | | | | | | | The patch fixes a number of bugs in code, and removes dead logic clarifying that MIPS DSP, like ARM NEON, has no runtime detecton. Change-Id: If2f4eea68da5b2eaa80b8e9c8258206d8c1b7173 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Implement generic text blend routinesAllan Sandfeld Jensen2017-02-031-36/+270
| | | | | | | | | | | | | | | | Implements a generic version of alphamapblit and alphargbblit so we can have gamma-corrected blending of text outside of only RGB32 formats. Change-Id: Ide960276357546558dd713aab66d2af0f2a09a2a Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | Implement clip part of qt_alphamapblit_quint16Allan Sandfeld Jensen2017-02-021-22/+47
| | | | | | | | | | | | | | | | Adds handling of clipping in qt_alphamapblit_quint16, this is also preparing for a generic implementation of alphamapblit. Change-Id: I706f08179abefa74f8de138369a0dc8ce19510fc Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | Manually vectorize ARGB32toARGB32PM for SSE4.1 and NEONAllan Sandfeld Jensen2017-01-311-12/+11
| | | | | | | | | | | | | | | | | | | | | | | | Manually vectorizing is significantly faster because we can optimize for common cases like long stretches of opaque or transparent pixels. This is both smaller and faster than the auto-vectorized version, it is also much faster than the autovectorized version for AVX2 which then can be removed. Change-Id: I0fa80ce273a8387cc6cd084879822ad9bade385c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2017-01-301-13/+1
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: examples/network/network-chat/peermanager.cpp src/widgets/util/qsystemtrayicon.cpp src/widgets/util/qsystemtrayicon_qpa.cpp src/widgets/util/qsystemtrayicon_win.cpp src/widgets/util/qsystemtrayicon_x11.cpp Change-Id: I1c026df83818c0ccaf956980370e7522960627db
| * Fix MIPS32 processor detectionAllan Sandfeld Jensen2017-01-241-13/+1
| | | | | | | | | | | | | | | | | | | | | | Gcc defines neither _MIPS_ARCH_MIPS32 nor __mips32 on MIPS32 architectures, instead __mips is defined to 32. This fix exposed bit-rot in qdrawhelper where qt_memfill32 was set as a function pointer despite not being one since Qt4. Change-Id: I87461823e54fa3166223ebf97175fd05d2f2fd16 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>