summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qimage.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove unnecessary math.h and limits.h includesAllan Sandfeld Jensen2015-02-041-1/+0
| | | | | Change-Id: I28c898f869ed3f03b08ff55f2972a38667c755ad Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-12-291-1/+1
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qbytearray.cpp src/gui/kernel/qplatformsystemtrayicon.cpp src/gui/kernel/qplatformsystemtrayicon.h src/plugins/platforms/xcb/xcb-plugin.pro Change-Id: I00355d3908b678af8a61c38f9e814a63df808c79
| * Doc: corrected broken links qtbaseNico Vertriest2014-12-231-1/+1
| | | | | | | | | | | | | | Task-number: QTBUG-43115 Change-Id: Ib441326083294a6d59d75510142b1481f7b0bc35 Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Martin Smith <martin.smith@digia.com>
* | Merge remote-tracking branch 'origin/5.4' into devSimon Hausmann2014-12-181-2/+9
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.h src/platformsupport/platformcompositor/qopenglcompositor.cpp src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp tests/auto/gui/kernel/qwindow/tst_qwindow.cpp Change-Id: I5422868500be695584a496dbbbc719d146bc572d
| * Fix incorrect QImage transformation when its devicePixelRatio != 1MihailNaydenov2014-12-121-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | QImage::transformed compensates for unwanted translation. This compensation is performed in "pixel space". However, a possible code path to perform the transformation uses QPainter which is devicePixelRatio-aware and expects the transformation matrix to be in logical coordinates. For example, image.transformed(QTransform().rotate(45)) will result in cropped out image if devicePixelRatio == 2. Change-Id: I830ff3ffa25531d842dc9c77f1d0e8d4bd502c9d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.4' into devOswald Buddenhagen2014-09-291-38/+24
|\| | | | | | | | | | | | | | | | | | | | | 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
| * Clean up QImage::Format switchesAllan Sandfeld Jensen2014-09-251-14/+8
| | | | | | | | | | | | | | | | | | | | Changes some switches on QImage::Format that needed to be updated whenever a new image format was added. Two were changed to matching formats supported by BMP and PPM instead of what they don't support, and two were changed to now use QPixelFormat values. Change-Id: I5a14f1d7b7cc0451c68e4d6ab2361a5bd8dc8915 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
| * Update license headers and add new license filesMatti Paaso2014-09-241-18/+10
| | | | | | | | | | | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
| * Merge "Merge remote-tracking branch 'origin/5.3' into 5.4" into refs/staging/5.4Frederik Gladhorn2014-09-241-0/+2
| |\
| | * Merge remote-tracking branch 'origin/5.3' into 5.4Frederik Gladhorn2014-09-231-0/+2
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | | * Let QImage::mirrored() retain dots-per-meter settingsaavit2014-08-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-40582 Change-Id: Iffeba44fa6d1f34331bb69ff9aabce88efe279a7 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
| * | | Fix QPixelFormat valuesAllan Sandfeld Jensen2014-09-241-4/+4
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | The two mono formats are actually indexed and may have both color and alpha values in the color-table, and Format_ARGB4444_Premultiplied and Format_ARGB6666_Premultiplied both have the alpha value in the end. Change-Id: I7f1efb2213710f5eb628d71356f9c8ed75b50f4d Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
| * | Remove pointless check in QImageData::create()Maks Naumov2014-09-171-1/+0
| | | | | | | | | | | | | | | | | | | | | "height <= 0" already verified above. Change-Id: Ia2ab90a4cd5533f7b5101686876c2c2cc3e275ac Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Add Grayscale8 and Alpha8 formats to QImage and drawingAllan Sandfeld Jensen2014-09-171-24/+75
|/ / | | | | | | | | | | | | | | | | | | | | | | 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: add a qMove()Marc Mutz2014-09-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The color table is passed by value (good for C++11), so when the argument is assigned to the member variable, that's a good spot for a move assignment. However, the argument is also declared const. The standard says that top-level const is ignored, but some compilers (I know about SunCC) think differently, so we cannot remove it. Instead, we do a const_cast. It is well-defined: Even though apparently the argument was declared as const, the standard says the const is not there, and no sane compiler would put the argument copy into read-only memory. Add a reminder to remove the top-level const from the signature come Qt 6. Change-Id: Iac18846ba669de0a30da620685ad1438c267e193 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | Document loading of high resolution versions of images.Friedemann Kleint2014-08-261-3/+4
| | | | | | | | | | | | Task-number: QTBUG-38858 Change-Id: I87ee18b66e137f5f5c01d77910f1a7f256b85e18 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* | Fix documentation and memrotate of new RGB30 QImage formatsAllan Sandfeld Jensen2014-08-141-1/+3
| | | | | | | | | | | | | | | | | | This patch contains two changes that were lost when RGB30 support was merged. Documentation of the formats being added, and corrected memrotate methods. Change-Id: Ia3c87d7c984134576badbba92c421f832896cf97 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* | QPixelFormat is better taken by-valueMarc Mutz2014-08-091-1/+1
| | | | | | | | | | | | | | Being a better quint64, it can be passed in registers, so take them as value args. Change-Id: I8eb96a2594d910b538b651fb3ca567c0c124dd3a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
* | Make sure that QPixelFormat is constexprThiago Macieira2014-08-061-1/+1
| | | | | | | | | | | | | | by declaring the array of formats constexpr too. Change-Id: I5c8e23ef9dc0fcac9c246f48dbee24c390d4583c Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Ensure valid data after QImage::invertPixelsAllan Sandfeld Jensen2014-07-311-3/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QImage::invertPixels may produce invalid data after inversions of images with premultiplied alpha, because the inverted colors will be larger than the alpha. This patch converts any image with a premultiplied alpha channel to ARGB32 before inverting the pixels, and then back to the original format after the inversion. Support is added for correct inversion of RGBA8888 and RGB30 formats. Task-number: QTBUG-39901 Change-Id: Ief24c55f495e67ef2ad6429b5b418d02963a64dd Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* | Keep global state of debug stream (QImage, QPixmap, and QIcon)Kai Koehne2014-07-231-9/+11
| | | | | | | | | | | | | | Make sure that the stream's formatting settings are preserved. Change-Id: Ib13b5e0b36b2ef801da2d2d5c240d28dc1b04653 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* | Improve debug output of QImage, QPixmap and QIcon.Friedemann Kleint2014-07-211-1/+12
| | | | | | | | | | | | Task-number: QTBUG-38858 Change-Id: Ie45d595478f971c7ed973d911c65484d947d2a60 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* | Rename QPixelFormat enum value to avoid conflict with X.h.Axel Rasmussen2014-07-141-2/+2
| | | | | | | | | | | | | | | | | | | | This commit fixes a potential compile error where pixelformat.h would not compile if X.h from x11proto was included first, since X.h #define's GrayScale as an integer constant. Task-number: QTBUG-40087 Change-Id: I7208a204259c6d3a13b5d0cbc98a76bb54b8b494 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* | QImage support for RGB30 formatsAllan Sandfeld Jensen2014-07-041-0/+147
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/5.3' into devFrederik Gladhorn2014-07-011-139/+135
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/qnx-x86-qcc/qplatformdefs.h src/corelib/global/qglobal.h src/network/socket/qnativesocketengine_winrt.cpp src/plugins/platforms/android/androidjniaccessibility.cpp src/plugins/platforms/windows/qwindowswindow.cpp Manually adjusted: mkspecs/qnx-armle-v7-qcc/qplatformdefs.h to include 9ce697f2d54be6d94381c72af28dda79cbc027d4 Thanks goes to Sergio for the qnx mkspecs adjustments. Change-Id: I53b1fd6bc5bc884e5ee2c2b84975f58171a1cb8e
| * Simplify mirroring code and add tests for non-aliged 1 bit imagesLaszlo Agocs2014-06-231-113/+97
| | | | | | | | | | Change-Id: I309714bc52de87c702194a4a82803d383f6ac3b3 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Correct QImage::fill(uint) on RGBA8888 formatsAllan Sandfeld Jensen2014-06-201-26/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QImage::fill(uint) was incorrectly performing ARGB->RGBA conversion when called on RGBA8888 formated images. This patch moves the color conversion to QImage::fill(QColor) where it belongs so that fill(uint) can behave consistent with documentation and how it treats other formats. The fill(uint) method had no automated tests, and this patch adds one. [ChangeLog][QtGui][QImage] QImage::fill(uint) now fills the given pixel value unconverted when used on RGBA8888 image, making it consistent with the documentation and treatment of all other image formats. Change-Id: I00a9d810c61d350dbdd7c4b9ad09e5ce11896b6d Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* | Introducing QPixelFormatJorgen Lind2014-04-231-0/+269
|/ | | | | | | | | Its purpose in life will be to describe pixel formats [ChangeLog][QtGui] Added QPixelFormat class Change-Id: I74d8f974606520efb3935110ff3d6ddb5ea805a8 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Fix some documentation errors.Friedemann Kleint2014-03-241-1/+1
| | | | | | | | Correct links and fix typos, remove obsolete documentation, fix some snippets, mark some classes as internal. Change-Id: I9a3266605f060783413d32740057a57a820c8929 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Export optimized premultiply and unpremultiply methodsAllan Sandfeld Jensen2014-02-101-4/+4
| | | | | | | | | | | | | | | | 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>
* Ensure QImage::pixel() on RGB32 images returns valid QRgb valuesAllan Sandfeld Jensen2014-01-291-0/+1
| | | | | | | | | | | | | Currently QImage::pixel() returns the raw underlying pixel values for RGB32. For all other pixel formats the returned value is either valid ARGB32 or ARGB32PM. This patch masks the undefined alpha field in RGB32 so that the return value is well defined QRgb. It also fixes one test that relied on the previous behavior. Change-Id: If37463528268b7419733499d1f7bfd0d1097d21e Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Fix performance regression in mirroring QBitmapAllan Sandfeld Jensen2014-01-291-1/+2
| | | | | | | | | | The recent split of qimage.cpp meant mirror_horizonal_bitmap had to access the bitflip array using a function call. The function call was placed in the inner loop, but should have been moved out of the loop as it can not be inlined. Change-Id: Id771b2fb7e6c2bfa59670ee96a857a529da13c0b Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Ref qualified version of QImage::convertToFormatAllan Sandfeld Jensen2014-01-231-1/+15
| | | | | | | | | | | Add ref qualified versions of QImage::convertToFormat, so that a temporary QImage can be converted in-place to a format of equal depth. [ChangeLog][QtGui][QImage]Added rvalue qualified convertToFormat method for in-place conversion Change-Id: I2eed5ffd63f5aea4ffa1147bf7607b02a49d9c5d Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Add generic inplace converterAllan Sandfeld Jensen2014-01-181-0/+2
| | | | | | | | | | | | 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>
* Avoid unnecessary double conversion over ARGB32 and ARGB32PMAllan Sandfeld Jensen2014-01-101-6/+5
| | | | | | | | | | | | | | | 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-2114/+3
| | | | | | | | | | 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>
* Inplace versions of QImage rgbSwapped() and mirrored() for rvalue refsAllan Sandfeld Jensen2014-01-081-110/+228
| | | | | | | | | Adds inplace version of QImage::rgbSwapped() and QImage::mirrored() that can be used on temporary QImage objects when supported by the compiler. [ChangeLog][QtGui][QImage]Rvalue qualified mirrored and rgbSwapped methods for inline conversions Change-Id: I4ffb658bf620dfc472d9db14c1aa70291c1fd842 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Merge remote-tracking branch 'origin/stable' into devSimon Hausmann2014-01-031-1/+1
|\ | | | | | | Change-Id: Id13badc270db98806048753fd7fb658aa17f1ede
| * Fix some typos in documentation.Jeff Tranter2014-01-021-1/+1
| | | | | | | | | | | | | | | | Fix some spelling and grammatical errors in comments that show up in Qt documentation. No changes to code. Change-Id: I2e946fda0bd9a2117f8e9b2fb300df9bf0a98a6c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* | Remove the files building AVX codeThiago Macieira2013-12-101-14/+1
|/ | | | | | | | | | | | | | | This feature was never completely implemented. Sure, it's nice to build the SSE2 + SSSE3 code with the VEX prefix, which results in better code. But the leap isn't that big anyway. This is the first step to removing the runtime detection for the drawhelpers. They create timebombs when we use inline functions. Task-number: QTBUG-30440 Change-Id: Ic53b2cf5261106a1c940d4a36eb6111b7d998be1 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Missing entry in QImage inplace_converter_mapAllan Sandfeld Jensen2013-11-151-0/+3
| | | | | | | | | The inplace_converter_map never had an entry for ARGB4444_Premultiplied this leads to the possibility of accessing outside of the array, and means the RGBA8888 formats are misplaced. Change-Id: Ida0d94912b53a7730b8fb5f6ccc31e7879ea3d27 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Doc: Fix broken linksSze Howe Koh2013-11-051-1/+1
| | | | | | | | Task-number: QTBUG-33360 Change-Id: Ic944cb2f575c35ebad64852ef5fc44a50ac03571 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Assert in QImage conversion from rgba8888pm -> rgba8888Allan Sandfeld Jensen2013-10-311-1/+1
| | | | | | | Fix typo in assert. Change-Id: I7dc056957b31a869eabe2e45feb99ae4fccb2d97 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Doc: Adding mark-up to boolean default values.Jerome Pasion2013-10-081-21/+21
| | | | | | | | | | | | | | | | | Default values should have mark-up to denote that they are code. This commit changes: -"property is true" to "property is \c true". -"Returns true" to "Returns \c true". -"property is false" to "property is \c false". -"returns true" to "returns \c true". -"returns false" to "returns \c false". src/3rdparty and non-documentation instances were ignored. Task-number: QTBUG-33360 Change-Id: Ie87eaa57af947caa1230602b61c5c46292a4cf4e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Doc: Add docs for rvalue references and move constructorsGeir Vattekar2013-09-271-0/+17
| | | | | | | | | These members were introduced in 4.8, but left undocumented. Because we consider undocumented API to be internal, the members are \since 5.2. Change-Id: I52e2840a8cfaa7f59f410b3e2a06c0942ea06539 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Fix some doc errors.Frederik Gladhorn2013-09-211-1/+1
| | | | | | | Change-Id: Ib874d7e9671d9cee75fe41f4dac5d0de7b09245e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Support RGBA image formatAllan Sandfeld Jensen2013-07-231-33/+656
| | | | | | | | | Support the byte-ordered RGBA format which is used by OpenGL, and many endian neutral byte formats. Task-number: QTBUG-32201 Change-Id: I77cffb4c30c69545fa96ded2f537b2ebd9351acb Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
* Remove use of 'register' from Qt.Stephen Kelly2013-06-171-5/+5
| | | | | | | | | | It is deprecated and clang is starting to warn about it. Patch mostly generated by clang itself, with some careful grep and sed for the platform-specific parts. Change-Id: I8058e6db0f1b41b33a9e8f17a712739159982450 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add devicePixelRatio metric to QPaintDevice.Morten Johan Sørvig2013-04-151-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously QPainter computed the devicePixelRatio based on the physical and logical dpi, and expected that the ratio between them would be either 1x or 2x. This was problematic for paint devices like printers where the physical dpi can be much higher than the logical dpi, and also for QScreen where the physical dpi would have to be defined as a multiple of the logical dpi. Add QPaintDevice::PdmDevicePixelRatio and QPaintDevice:: devicePixelRatio() getter and implement it for the QPaintDevice subclasses. Use it when calculating the highdpi scale transform in qpainter.cpp and when scaling the clip rect in qwidget.cpp. Remove physical dpi scaling for QImage, QPixmap and QOpenGLPaintDevice, reverting to the old behavior. Change-Id: I6c97510613196d4536ff39d08e9750b8782283d4 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Fix missing devicePixelRatio propagation on copy.Morten Johan Sørvig2013-03-291-0/+1
| | | | | Change-Id: I0cb541fe8a92b7a7c159e0a6e5036baf43185a93 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>