summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-10-271-1/+5
|\ | | | | | | | | | | | | Conflicts: src/gui/text/qfontdatabase.cpp Change-Id: I6ac1f55faa22b8e7b591386fb67f0333d0ea443d
| * Fix printing of semitransparent images to PDFAllan Sandfeld Jensen2014-10-241-1/+3
| | | | | | | | | | | | | | | | | | | | The patch marks the image data to be inverted when a soft mask is used. Without this any embedded image with semitransparent pixels would be decoded with inverted colors. Task-number: QTBUG-31540 Change-Id: Ia607f7c1acf542ecf3bc88d713dfd87785b43f40 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Correctly apply miter limits when stroking linesLars Knoll2014-10-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | The PDF generator was in many cases not correctly applying miter limits to the generated strokes leading to drawing artifacts for very sharp edges. Task-number: QTBUG-37903 Change-Id: Ie93b0f4a56775729105a375ba3bcdb5b58993433 Reviewed-by: Gunnar Sletta <gunnar@sletta.org> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-10-201-2/+1
|\| | | | | | | Change-Id: If7e51514ed6832750e3ad967e4d322ccf920d2bb
| * Correct QPainter::clipPath() documentation.Mitch Curtis2014-10-201-2/+1
| | | | | | | | | | Change-Id: Ie8ea01eee23e28378eadca0e87dc89fd62aec14f Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-10-098-41/+45
|\| | | | | | | Change-Id: I05fcd8dc66d9ad0dc76bb7f5bae05c9876bfba14
| * Don't stream QStringLiterals into QDebugMarc Mutz2014-10-092-2/+2
| | | | | | | | | | | | | | | | Normal (C) string literals do just as well and use more than twice less space in the DATA section. Change-Id: Iafb0682a362c41dfd5b4d8b9137d88014d7992a2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Don't use QStringLiteral in startsWith/endsWidthMarc Mutz2014-10-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For QLatin1String, startsWith/endsWith is overloaded, so comparing to a latin-1 (C) string literal is efficient, since strlen() is comparatively fast. OTOH, QStringLiteral, when not using RVO, litters the code with QString dtor calls, which are not inline. Worse, absent lambdas, it even allocates memory. So, just use QLatin1String instead. Change-Id: I7eaf464c67b55116f970fe7f58a85f19ce4d254e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * QBrush: be more robust in detach()Marc Mutz2014-10-031-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If detach() was called with a newStyle corresponding to a gradient, but with d->style not a gradient, it would execute an invalid cast and read invalid memory. The reason this has not been seen in practice is that a non-gradient brush instance can currently never become a gradient one. But that may change when someone adds an operator=(QGradient), so in the interest of robust code, add a check to verify the old style was a gradient before accessing the corresponding member. Change-Id: I216a144d31a9ed7145bcd829f3ae5f44a41672db Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
| * QRegion: fix a valgrind warningMarc Mutz2014-10-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When: - i == 0 (at end of current POINTBLOCK), - numFullPtBlocks == 1 (only one more POINTBLOCK left) and - iCurPtBlock == 0 (last block contains no points), Valgrind rightfully complained about an invalid read: Conditional jump or move depends on uninitialised value(s) at 0x517B08B: PolygonRegion(QPoint const*, int, int) (qregion.cpp:3480) Fixed by setting 'next' to nullptr when !numFullPtBlocks OR !iCurPtBlock. Change-Id: If5225fdfa66f2910a8aafb675cd02b40c0a81ad9 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
| * Doc: Removed a few references to the outdated featuresVenu2014-10-021-8/+1
| | | | | | | | | | | | | | | | | | | | OpenVG support and the -graphicssystem command-line option is not available since Qt 5.0. Change-Id: I19c89cd3bb2c4a2215cdfae9fd783dece637b30f Task-number: QTBUG-41265 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
| * Merge "Merge remote-tracking branch 'origin/5.3' into 5.4" into refs/staging/5.4Gabriel de Dietrich2014-10-013-3/+15
| |\
| | * Merge remote-tracking branch 'origin/5.3' into 5.4Gabriel de Dietrich2014-09-293-3/+15
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/network/socket/qnativesocketengine_unix.cpp src/widgets/kernel/qwidget_qpa.cpp Change-Id: I6f1aa320d5ca66cd92d601a95885aeaab0abb191
| | | * QTransform: initialize the d memberGiuseppe D'Angelo2014-09-222-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Although never used, the d member triggers all sorts of warnings when copying a QTransform around because it's technically undefined behavior (reading from an uninitialized variable). Change-Id: If06b6bea6f0ec0623c38ba330d46958b373cdc65 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
| | | * QRegion: fix a memory leakGiuseppe D'Angelo2014-09-221-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An early return in case of errors leaked memory tracked in a variable in scope. Change-Id: I68cd77890608caff54df7476d38850e5541ce76e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
| * | | Fix regression in metric calculation of text with mnemonicsAllan Sandfeld Jensen2014-10-011-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even when we do not intend to display the text, we still need to go through the processing of mnemonics to remove them from the text. Instead of capping the max underlines to 0, the TextDontPrint option now just saves adding the underline formats. Task-number: QTBUG-41593 Change-Id: I67790650dbed0092de2c63e5d5a9349dc02d5846 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Robert Loehning <robert.loehning@digia.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
| * | | Make QRegion::shared_empty constMarc Mutz2014-09-292-18/+13
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | Continuing the trend of QString, QVector, etc. Change-Id: I8f53d4abfa0dd941bfdfd3c1a9049a42dbf92691 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.4' into devOswald Buddenhagen2014-09-29101-1977/+1216
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-24/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | Fix smooth scaling of large QImagesAlex Blasche2014-09-251-12/+13
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-13448 Change-Id: Ie76f5b5deefabeae93ab17eb866aea303692f5ac Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * | Update license headers and add new license filesMatti Paaso2014-09-24101-1909/+1101
| | | | | | | | | | | | | | | | | | | | | | | | | | | - 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-244-4/+37
| |\ \
| | * | Merge remote-tracking branch 'origin/5.3' into 5.4Frederik Gladhorn2014-09-234-4/+37
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | | * Add missing private headers warningSamuel Gaist2014-09-043-0/+33
| | | | | | | | | | | | | | | | | | | | Change-Id: I7a4dd22ea3bcebf4c3ec3ad731628fd8f3c247e0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | | * Initialize textureId in platform backing storeLaszlo Agocs2014-08-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Setting it initially to 0 is very important, otherwise we will do a glDeleteTextures with the undefined value. The result sometimes goes unnoticed and sometimes causes bizarre issues: For example in the 'textures' example one face of one cube out of the six did go blank from time to time since the corresponding texture was deleted by the backingstore. Change-Id: Iebf68e20b2af426c979980d8bc4449db2b98f2f0 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
| | | * Fix QPainter::drawPolyline() painting errors with cosmetic penaavit2014-08-141-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-31579 Change-Id: I8fd2c03ff9a22e4963bfcbcfe196ae4c61b9e10f Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
| * | | QRegion: Reorganise members to reduce padding in EdgeTableEntryMaks Naumov2014-09-231-1/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | On 64-bit platforms: 64 -> 56 bytes. On 32-bit platforms it's still the same size (44 bytes). Change-Id: I681b9385ee3bc7601c1e8036efd6544471d1e058 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | Fix default implementations of raster opsEskil Abrahamsen Blomfeldt2014-09-201-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the list of default implementations, the raster ops added in ae0ddb8c729c105a5b4f32a4f6765af8fe546333 were all offset by one composition mode because of a duplicate entry in the array. The effect would be, e.g. that using the NotDestination operator would resolve to the Set operator instead. Most users will probably not have experienced this since any of the asm-based functions will be preferred. [ChangeLog][Painting] Fixed some very rare cases of mismatched raster modes in QPainter. Change-Id: Ia242b54c78acbe1c89d9b4ecd10936564ec134b2 Task-number: QTBUG-41413 Reviewed-by: Andy Shaw <andy.shaw@digia.com>
| * | QPaintBuffer paints drawGlyphRun with wrong fontAllan Sandfeld Jensen2014-09-192-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If QRawFont and and drawGlyphRun is used on a QPaintBuffer it will lose the QRawFont and end up painting with primary font at the time. With this patch, QStaticTextItem can now indicate that they must be drawn using the supplied font-engine and that the font information is not enough. Change-Id: Id6bd376d797d2bfb457e7de55c48bdcf9f20ae38 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
| * | Fix menu mnemonic inside ligaturesAllan Sandfeld Jensen2014-09-181-12/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code to draw underlines on specific characters in widget menu could not handle ligatures. Instead of using special code to handle this case this patch changes the mnemonic underlines to use normal format-ranges making the text engine deal with splitting ligatures as necessary. Task-number: QTBUG-20960 Change-Id: I6159110eae7aa8c819af16ba4a393d758871e2e0 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
| * | QRegion: Reorganise members to reduce padding in QRegionPrivateMaks Naumov2014-09-161-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | On 64-bit platforms: 56 -> 48 bytes. On 32-bit platforms it's still the same size (44 bytes). Change-Id: Ia4831753258ef12aa983757523bb76979e6fc4b0 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * | QRegion: remove some toplevel const from return typesMarc Mutz2014-09-102-8/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It has no effect and inhibits move semantics. After this change, two and five more copies are moves in QtGui and QtWidgets, resp. Keep the old form for compilers that mangle the return type. Change-Id: I6257683144110230079fe9095303907ecc858c94 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Add Grayscale8 and Alpha8 formats to QImage and drawingAllan Sandfeld Jensen2014-09-175-74/+482
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | QPainter: use qEnvironmentVariableIsEmpty()Marc Mutz2014-09-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | It doesn't allocate memory, so cannot throw and is a lot faster than qgetenv(). Change-Id: I1ac14bb3d262201071025a885633886934f2d74c Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | | QPainter: use qEnvironmentVariableIntValue()Marc Mutz2014-09-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | It doesn't allocate memory, so cannot throw and is a lot faster than qgetenv(). Change-Id: Ie41b95c09f2c6106a6683ba4637513c974555840 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | | QPainter: drop a pointless checkMarc Mutz2014-09-121-3/+1
| | | | | | | | | | | | | | | | | | | | | There's no need to check for nullptr before invoking delete. Change-Id: Ied751f76f15f390bf86bbba53c14a3e450aa81e8 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | | QPainter: use qDeleteAll()Marc Mutz2014-09-121-2/+1
| | | | | | | | | | | | | | | Change-Id: I167e4d7a57e92eb5ea7c39b04246ac2f44c91de0 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | | Merge remote-tracking branch 'origin/5.4' into devOswald Buddenhagen2014-09-101-2/+1
|\| | | | | | | | | | | Change-Id: Id4997327cc01bd4bb397a463bdffbd15e80398ef
| * | QRegion: remove check for null ptr after "new" operatorMaks Naumov2014-09-091-2/+1
| | | | | | | | | | | | | | | | | | | | | Change-Id: Iebba0b1f024e22cd36a04c53377b3958638b389e Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | | QColor: remind to remove copy ctor for Qt 6Marc Mutz2014-09-021-1/+1
| | | | | | | | | | | | | | | Change-Id: Ib3fc880ec5c856cc9a7573349f63052f0a00734b Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | | qPremultiply(QRgb): let the compiler see all versionsMarc Mutz2014-09-021-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use a template helper function and template specialization to select which of the two versions (64bit / 32bit) to use. This makes the compiler see both versions on all platforms, enabling better syntax checking should either of the two change. It also will fail to compile on platforms where the word size is neither 4 nor eight bytes now... And, of course, it's always satisfying to remove a use of the preprocessor. Change-Id: I4870411f99eb3b1a2c0c170fa53fa3c9b026da15 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | | QPdf: Extract Method is_monochrome()Marc Mutz2014-09-021-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old code repeatedly evaluated QImage::colorTable(), which returns a vector by value. Instead, factor the checks performed on the color table into a helper function and pass the color table to it, reducing the number of evaluations from three to one. Also makes the code more readable, because the condition now fits on a single line. Change-Id: I82773c235047e76b87c8a9d630f7df9440430351 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
* | | QtGui: add missing qrgb.h to painting.priMarc Mutz2014-09-021-0/+1
| | | | | | | | | | | | | | | Change-Id: I7124bf4e4675307c633bf705092aad1ee3360761 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-09-014-31/+35
|\| | | | | | | | | | | Change-Id: I2811ff0b9d4097f0be60ff16e9664a5060cff23e
| * | Use ctor-init-list in QRegionPrivate(QRect) ctorMarc Mutz2014-08-261-5/+6
| | | | | | | | | | | | | | | | | | Change-Id: I531b862db7bdec0a504c6022c1a15635aaf3fc8d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
| * | QRegionPrivate: remove copy ctor and assignment operatorMarc Mutz2014-08-261-17/+0
| | | | | | | | | | | | | | | | | | | | | | | | They're identical to the compiler-generated ones, and probably inhibit move operators here and there. Change-Id: I918f2946f6b6aa49aa883420dc87df44013938a5 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
| * | Document loading of high resolution versions of images.Friedemann Kleint2014-08-261-6/+25
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-38858 Change-Id: I87ee18b66e137f5f5c01d77910f1a7f256b85e18 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
| * | Initialize textureId in platform backing storeLaszlo Agocs2014-08-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Setting it initially to 0 is very important, otherwise we will do a glDeleteTextures with the undefined value. The result sometimes goes unnoticed and sometimes causes bizarre issues: For example in the 'textures' example one face of one cube out of the six did go blank from time to time since the corresponding texture was deleted by the backingstore. Change-Id: Id19eb2164471b542b08a277a65edfcb5d0f8248d Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
| * | Fix composition for translucent AlwaysStackOnTop widgetsLaszlo Agocs2014-08-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Writing out the alpha is re-enabled too early. When blitting the AlwaysStackOnTop widgets as the last step of the composition, they need the exact same settings as the backingstore content, meaning blending but without writing out alpha. Move the glColorMask call to fix this. This will avoid issues with semi-transparent AlwaysStackOnTop widgets when the top-level has alpha enabled too. Task-number: QTBUG-40910 Change-Id: Id6d0d684cfa78bf79b65a097efd92de575e73b2c Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
| * | Merge "Merge remote-tracking branch 'origin/5.3' into 5.4" into refs/staging/5.4Giuseppe D'Angelo2014-08-191-2/+2
| |\ \