summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qimage_conversions.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2015-02-101-3/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/3rdparty/harfbuzz-ng/harfbuzz-ng.pro src/gui/image/qimage_conversions.cpp src/gui/opengl/qopenglextensions_p.h src/gui/text/qtextengine.cpp src/network/ssl/qsslsocket_openssl.cpp src/plugins/platforms/eglfs/qeglfshooks_stub.cpp src/plugins/platforms/eglfs/qeglfsscreen.cpp src/plugins/platforms/eglfs/qeglfswindow.cpp src/plugins/platforms/windows/qwindowsfontdatabase.cpp src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp src/plugins/platforms/windows/qwindowsnativeinterface.cpp src/plugins/platforms/windows/qwindowsscreen.cpp src/plugins/platforms/windows/qwindowswindow.cpp src/plugins/platforms/windows/qwindowswindow.h src/plugins/platforms/xcb/qxcbdrag.h src/widgets/itemviews/qabstractitemview.cpp src/widgets/kernel/qwidget.cpp src/widgets/util/qsystemtrayicon_p.h tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp Thanks to Friedemann Kleint for resolving the qwindowsfontdatabase.cpp conflicts. Change-Id: I937232c30523d5121c195d947d92aec6f129b03e
| * Correct inplace conversion methods from RGBA8888 formatsAllan Sandfeld Jensen2015-02-031-3/+3
| | | | | | | | | | | | | | | | The methods for inplace conversion from RGBA to ARGB was misplaced by one step causing conversion to RGB16 to get an invalid method. Change-Id: I3b2b4cffe993705c48613eec7d9b7c6213f57fc2 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
| * qimage_conversions.cpp: Fix build on big endian systemsDmitry Shachnev2014-12-091-2/+2
| | | | | | | | | | | | Change-Id: I8149eb2deaa101daf85a957ff48c3a7140c43bbc Reviewed-by: Timo Jyrinki <timo.jyrinki@canonical.com> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | Generate SSE4.1 versions of premultiplying methods where convenientAllan Sandfeld Jensen2015-02-041-3/+29
| | | | | | | | | | | | | | | | | | | | The autovectorized versions of premultiplying conversions are almost twice as fast with SSE4.1 as with SSE2. Therefore this patch lets compilers that can make those versions convenient without duplicating code do that and lets us use them when available. Change-Id: I699035963abe55a38b9ef8ba7b4a8c961c8dfcdd Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-11-241-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qiodevice.cpp src/plugins/bearer/linux_common/qofonoservice_linux.cpp src/plugins/bearer/linux_common/qofonoservice_linux_p.h src/plugins/platforms/android/qandroidplatformtheme.cpp src/tools/bootstrap/bootstrap.pro src/widgets/styles/qmacstyle_mac.mm Change-Id: Ia02aab6c4598ce74e9c30bb4666d5e2ef000f99b
| * Don't build or use qt_convert_rgb888_to_rgb32_neon on ARM64/AArch64Tor Arne Vestbø2014-11-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The assembly code doesn't build on that architecture yet: qimage_neon.cpp:78:17: error: vector register expected "vld3.8 { d0, d1, d2 }, [%[SRC]] !\n\t" ^ <inline asm>:1:15: note: instantiated into assembly here vld3.8 { d0, d1, d2 }, [x1] ! ^ qimage_neon.cpp:78:57: error: unrecognized instruction mnemonic "vld3.8 { d0, d1, d2 }, [%[SRC]] !\n\t" ^ <inline asm>:2:2: note: instantiated into assembly here vswp d0, d2 ^ qimage_neon.cpp:79:31: error: vector register expected "vswp d0, d2\n\t" ^ <inline asm>:3:15: note: instantiated into assembly here vst4.8 { d0, d1, d2, d3 }, [x8,:64] ! ^ Change-Id: I8fe93b3940d971c0aed5973fe6e1a5e2f362df3c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-10-091-2/+1
|\| | | | | | | Change-Id: I05fcd8dc66d9ad0dc76bb7f5bae05c9876bfba14
| * Merge remote-tracking branch 'origin/5.3' into 5.4Gabriel de Dietrich2014-09-291-2/+1
| |\ | | | | | | | | | | | | | | | | | | | | | Conflicts: src/network/socket/qnativesocketengine_unix.cpp src/widgets/kernel/qwidget_qpa.cpp Change-Id: I6f1aa320d5ca66cd92d601a95885aeaab0abb191
| | * Prevent a Coverity warning about a dangerous code pathGiuseppe D'Angelo2014-09-221-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Coverity warns that we may access the gray array without initializing it. The array is initialized if d (the source image depth) is 8. However, when doing ordered dithering, we don't check that depth any more and just use the array. There are instead checks in place for the other dither modes; the one for ordered has been commented out before public history. So, for the love of kittens, put the check back. Change-Id: I1cc5ced8edbb626777e54e9f4e58f152c6b28ddc Reviewed-by: Gunnar Sletta <gunnar@sletta.org> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | Merge remote-tracking branch 'origin/5.4' into devOswald Buddenhagen2014-09-291-20/+14
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qbytearray.cpp src/gui/image/qimage.cpp src/gui/image/qppmhandler.cpp src/gui/kernel/qguiapplication.cpp src/gui/painting/qpaintengine_raster.cpp Change-Id: I7c1a8e7ebdfd7f7ae767fdb932823498a7660765
| * | Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
| * | Merge remote-tracking branch 'origin/5.3' into 5.4Frederik Gladhorn2014-09-231-1/+3
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The isAlwaysAskOption was removed in 38621713150b663355ebeb799a5a50d8e39a3c38 so manually removed code in src/plugins/bearer/connman/qconnmanengine.cpp Conflicts: src/corelib/global/qglobal.h src/corelib/tools/qcollator_macx.cpp src/corelib/tools/qstring.cpp src/gui/kernel/qwindow.cpp src/gui/kernel/qwindow_p.h src/gui/text/qtextengine.cpp src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h src/plugins/platforms/android/qandroidinputcontext.cpp src/plugins/platforms/xcb/qglxintegration.cpp src/plugins/platforms/xcb/qglxintegration.h src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/testlib/qtestcase.cpp src/testlib/qtestlog.cpp src/widgets/dialogs/qfiledialog.cpp src/widgets/kernel/qwindowcontainer.cpp tests/auto/corelib/tools/qcollator/tst_qcollator.cpp tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp Change-Id: Ic5d4187f682257a17509f6cd28d2836c6cfe2fc8
| | * Fix invalid memcpy(dst, src) calls where dst == srcAllan Sandfeld Jensen2014-08-201-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | The convert_generic_inline method was not correctly handling the case where both the conversion methods were passthrough and the last store is therefore not needed and may trigger an invalid memcpy call. Change-Id: Ic88780f50e1ff9dedc04b8ff1ab3527dd0c8150c Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* | | Add Grayscale8 and Alpha8 formats to QImage and drawingAllan Sandfeld Jensen2014-09-171-43/+294
|/ / | | | | | | | | | | | | | | | | | | | | | | Extend the QImage format with two 8-bit grayscale and alpha formats. These formats have the advantage over Indexed8 that they have simpler conversion and can be rendered to by the raster engine. [ChangeLog][QtGui][QImage] Added support grayscale and alpha 8-bit formats which can also be rendered to. Change-Id: I4343c80a92a3dda196aa38d0c3ea251b094fc274 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | QImage support for RGB30 formatsAllan Sandfeld Jensen2014-07-041-34/+569
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds basic support for 10-bit per color channel formats to QImage and the XCB plugin. This will make it possible to paint to and from these formats, but only at 8-bit per color channel accuracy. This also fixes Qt5 applications on X11 with native 30bit depth. [ChangeLog][QtGui][QImage] Added support for 10-bit per color channel image formats. Task-number: QTBUG-25998 Change-Id: I93ccd3c74bfbb0bd94b352476e5fe58a94119e1f Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* | MIPS: Support recognition of the DSP ASE at run-timeAdrian Perez de Castro2014-06-271-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | Add detection of MIPS DSPr2 at run-time in qsimd.cpp. This makes it possible to have generic Qt builds for MIPS that can enable the fast code paths for processors with the DSP ASE at run-time. Also, this makes it possible to manually disable them by setting the environment variable "QT_NO_CPU_FEATURE=dspr2". Last, but not least, functions requiring DSPr2 are not enabled when running in CPUs with version-1 DSP. Change-Id: Ia5a01d84119553c22ab83386c74a6cb8ba5fee53 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | MIPS: Fast path for rgb888 to rgb32 conversionAdrian Perez de Castro2014-03-061-1/+5
|/ | | | | | | | | | Add a hand-coded MIPS assembler function to convert a stream of rgb888 bytes to an array of 32-bit ARGB values. This is used in QImage for image conversion, and also in QJpegHandler for decoding JPEG image scanlines. Change-Id: Ia74a5ff799b29fad3d4acbfcafe790cd60586d72 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-02-121-1/+1
| | | | | | | | | | Conflicts: src/gui/image/qimage.cpp src/gui/text/qtextengine.cpp src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp src/printsupport/kernel/qprintengine_win.cpp Change-Id: I09ce991a57f39bc7b1ad6978d0e0d858df0cd444
* Export optimized premultiply and unpremultiply methodsAllan Sandfeld Jensen2014-02-101-13/+13
| | | | | | | | | | | | | | | | This patch optimizes the unpremultiply method further by using a lookup table to avoid any divisions at all. The opportunity is taken to export both premultiply and unpremultiply since they are commonly used methods relevant to the exported QRgb type that can be both premultiplied and unpremultipled ARGB. [ChangeLog][QtGui][QColor] Exported highly optimized methods for premultiply and unpremultiply of QRgb values. Change-Id: I658bcf57b0bc73c34c1765b64617d43b63ae820b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-01-201-0/+6
| | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.h src/corelib/tools/qstring.cpp src/gui/image/image.pri src/gui/image/qimage.cpp src/plugins/platforms/cocoa/qcocoawindow.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/eglfs/qeglfshooks_stub.cpp tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp Change-Id: I3b9ba029c8f2263b011f204fdf68c3231c6d4ce5
* Add generic inplace converterAllan Sandfeld Jensen2014-01-181-0/+34
| | | | | | | | | | | | The generic converter can easily be modified to work inplace. Such an inplace converter can ensure we can do direct conversion between formats of similar pixel depth. Inplace conversion is currently only used by QPixmaps, but will be used by ref qualified versions of QImage::convertToFormat in a future patch. Change-Id: Idbdaf087b53deecdee8258ba0b5d80edd37cfe79 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Remove runtime detection of Neon on ARM CPUsThiago Macieira2014-01-161-8/+5
| | | | | | | | | | | | | Now the only way to enable Neon support is to change the mkspec. [ChangeLog][Important Behavior Changes] Qt no longer checks for support for the Neon FPU on ARM platforms at runtime. Code optimized for Neon must be enabled unconditionally at compile time by ensuring the compiler supports Neon. You may need to edit your mkspec for that. Task-number: QTBUG-30440 Change-Id: I4df9b2bf3cd022f8ed70f02f16878cb2cb3fe6fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Remove runtime detection of SSE2Thiago Macieira2014-01-161-14/+15
| | | | | | | | | | | | | | | | | | If the compiler supports SSE2, we'll use our SSE2-optimised code unconditionally. Runtime detection is left for SSSE3 code. The SSE2 codebase is big and thus a timebomb if an inline function gets leaked out and run without runtime check. In reality, it's extremely unlikely people running CPUs without SSE2 support are running Qt 5 at this moment (they're either too old or too new, e.g. Intel Quark). The SSSE3 codebase is a lot more manageable. Task-number: QTBUG-30440 Change-Id: I3e586e4434e820365d5316b650ee3061d0acf767 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Avoid unnecessary double conversion over ARGB32 and ARGB32PMAllan Sandfeld Jensen2014-01-101-53/+45
| | | | | | | | | | | | | | | Currently if the converter_map does not have an entry for how to do a direct conversion, the image is first converted to ARGB32 and then to the final format. In most cases the conversion to ARGB32 is the generic converter which convert over ARGB32PM, which mean the data is converted to ARGB32PM then to ARGB32, then to ARBG32PM and then to final format. This patch uses the generic converter directly everywhere there isn't an optimized converter declared and it is valid. Change-Id: Ibad57432ef8c58025e63a032b09f92dad4a559ee Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Clean up qimage.cpp by moving all the conversions methods outAllan Sandfeld Jensen2014-01-101-0/+2153
A large part of qimage.cpp is the implementation of the various conversions methods from one format to another. These methods could all be moved to a separate file to make qimage.cpp smaller, and possible later enable more aggressive optimization on the conversions. Change-Id: I355806710281b4222114cdd9c35a7c28cbc0f692 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>