summaryrefslogtreecommitdiffstats
path: root/src/gui
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-09-211-6/+8
|\ | | | | | | Change-Id: I9cfefaf22b010fca937be77979f5fb50574bb71e
| * QBrush: Fix UB (non-virtual dtor) in QBrush::detach()Marc Mutz2016-09-181-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As the d-pointer, QBrush uses a QScopedPointer with a custom deleter that checks for QBrushData::style and casts the QBrushData pointer down to corresponding subclasses before calling delete on them. In QBrush::detach(), however, any of the three brush data classes were held in a QScopedPointer _without_ the custom deleter, invoking UB when that scoped pointer would ever get to be the one that deleted the payload instead of handing it over to the objects d-pointer. Found by making dtors protected following a Coverity report wrongly marked as 'dismissed' (these static checks are not included in this patch, since they are binary-incompatible), to find out where Coverity could possibly see a problem. Also replace the d.reset(x.take()) that allowed this mismatch to compile with d.swap(x), which nicely ensures that x and d are of the same type. Coverity-Id: 11772 Change-Id: I85e2c205df9291bd7508b6c90f7b03fbe8c3bcd2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-09-162-5/+5
|\| | | | | | | | | | | | | Conflicts: src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp Change-Id: I0af32ee55936d523cbd259b6fe82eb9c409f9074
| * Fix typos in highdpi docsFrederik Gladhorn2016-09-151-4/+4
| | | | | | | | | | | | Change-Id: I15fd6859ff777388a229e3cb10de45886fe543fb Reviewed-by: Nico Vertriest <nico.vertriest@theqtcompany.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| * Taking trailing whitespace into account when shaping linesDavid Schulz2016-09-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | The calculated end position of script lines, consisting of nothing but trailing spaces, is lower than the start position. This results in not shaping those script lines. Task-number: QTBUG-55255 Change-Id: Ib70c1a800d2f70b7f61e3d05c10618e275f45f12 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-09-055-35/+46
|\| | | | | | | | | | | | | Conflicts: tests/auto/testlib/selftests/generate_expected_output.py Change-Id: If856162abf9a24ae2c9946d336a7d1da03520fa7
| * Fix crash when rendering to grayscale8 imagesAllan Sandfeld Jensen2016-09-031-32/+33
| | | | | | | | | | | | | | | | | | An entry was missing in one of the tables. This patch adds it back in and adds the enum comments used to keep track of whether they all are there and correctly set. Change-Id: Ic6a55a8f81f9c42a3174a2a75c80c3a354f173b7 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * Ensure the fontdatabase is initialized when requesting fallbacksAllan Sandfeld Jensen2016-09-031-0/+4
| | | | | | | | | | | | | | | | | | | | Otherwise we will return an empty list of fallbacks if no QFontDatabase has been created yet. Task-number: QTBUG-55222 Change-Id: I50508162fad3206e0acf3cc6eb39aefac5c3e197 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| * Fix unused variable warning on iOSJake Petroules2016-08-311-1/+1
| | | | | | | | | | Change-Id: Ieae5d7833b45a49a743a52a437d5383bd8a962c5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * QIcon: Set the pixmap's dpr to 1.0 if the window is also set to 1.0Andy Shaw2016-08-301-2/+5
| | | | | | | | | | | | | | | | | | | | | | When the pixmap is initially from a higher device pixel ratio and it is being used on a window that does not have a device pixel ratio other than 1.0 set then the pixmap should also have it set to 1.0. This ensures that the size of the pixmap is preserved and it is not scaled down as a result on the normal display. Change-Id: Ie5d96b3e1508867b723000bea182c8157640af02 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| * Guard against calling QWindow::requestUpdate() on non-GUI threadsTor Arne Vestbø2016-08-301-0/+3
| | | | | | | | | | | | Change-Id: I851ff672bc234146deb61615fc7c56df87d62065 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* | Fix QWindowPrivate::globalPosition() for foreign windowsFriedemann Kleint2016-08-301-2/+8
| | | | | | | | | | | | | | | | | | | | | | Use mapToGlobal(QPoint(0, 0)) when encountering a foreign window in the parent hierarchy as it is not clear whether it is a native top level or child. In the latter case, using the position is not sufficient. Task-number: QTBUG-43252 Change-Id: I5eebb1f0dbc6a0abbd968c5d383d3eded75c11a5 Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* | QIcon::addFile(): Invoke QMimeDatabase when matching by suffix failsFriedemann Kleint2016-08-301-18/+22
| | | | | | | | | | | | | | | | | | This will detect image files correctly even if case resource aliases without suffixed are used. Task-number: QTBUG-55388 Change-Id: I337ca1f6be7126fe731e5e278b23aaef6cdfd9ef Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-294-8/+9
|\| | | | | | | | | | | | | | | Conflicts: configure src/plugins/platforms/winrt/qwinrtclipboard.cpp Change-Id: Ic6d58be3d1ed2bb507f2ba06c82361afd9f9ddb9
| * QTextDocument: fix string backward searchSamuel Gaist2016-08-281-1/+1
| | | | | | | | | | | | | | | | | | [ChangeLog][QtGui][QTextDocument] Fixed a bug that would return a wrong position when searching backward from the end of the document. Task-number: QTBUG-48182 Change-Id: I6e88f808a50cb840f61e7bc579e2a28c5300089d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * QOffscreenSurface: warning-fix - QString(char*) deprecatedEdward Welbourne2016-08-251-1/+1
| | | | | | | | | | | | | | | | Passing a string literal to QWindow::setObjectName() is rude: it wants a QString. Change-Id: Ic4c1079889002f0d5f1028c443456a8be0b7b0fe Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| * Correct use of qt_div_255Allan Sandfeld Jensen2016-08-252-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qt_div_255 does a fast rounded division, the form of rounding is however only valid for positive integers. Correct one case where it was used incorrectly and add it one place it would be valid, and adds a comment to the function. We were using the optimization (x*a + y*(255-a))/255 == (x-y)*a/255 + y but that makes the division by 255 potentially negative. Change-Id: Ie53aa82b66ef801f5d43f8d2ec48880cb4972f69 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-255-40/+39
|\| | | | | | | | | | | | | | | Conflicts: src/corelib/mimetypes/qmimeprovider.cpp src/corelib/mimetypes/qmimetype.cpp Change-Id: Ib483ddb6bfc380e7c8f195feca535703814c3872
| * Fix crash when exiting while stacked modal dialogs are shownFriedemann Kleint2016-08-251-0/+2
| | | | | | | | | | | | | | | | | | | | Remove QWindow instance from QGuiApplicationPrivate::modalWindowList in the destructor. Task-number: QTBUG-54566 Change-Id: I1f07fb46a371f69f04907b20657f3b05571445bd Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
| * QKeySequence: remove 239 unneeded relocationsMarc Mutz2016-08-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Same change as in QColor (d38f86e50b01c6dd60f5a97355031e08d6a47d18). relocs: -239 text: -586B data: -3840B (optimized GCC 6.1 Linux AMD64 build). Change-Id: I180e9b65736481dd4e82dc68ef6c3f7541e205cf Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * QKeySequence: replace an array end marker by static size calculationMarc Mutz2016-08-241-4/+4
| | | | | | | | | | | | | | | | | | | | | | This improves code generation, since the compiler statically knows the number of loop iterations. But it also fixes a compile-error on Clang with a following change of the name field from char* to char[]. Change-Id: I7ef18adf3cb9b34cd1b7235cb35cf26b7e349d92 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * Limit glyph caches per QFontEngine to four per context, not four in totalTor Arne Vestbø2016-08-242-35/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The limitation of four glyph caches per font engine was to prevent memory spikes during rotation of text. But in an application with multiple top level OpenGL windows, each with their own context, we'd end up trashing the list of glyph caches during rendering, even if each window just drew the same static text. Having a shared context between the windows helped a bit, but had other performance issues due to the globally shared state, so the better approach is to limit the caches to four per context. This brings the multiwindow manual test from a grinding 4fps on macOS to a smooth 60fps for 20 concurrent windows. Task-number: QTBUG-52372 Change-Id: I26edd5f6edb5c7818e14b2203af062df19ae7127 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Make QWindow backed QOffscreenSurfaces easier to identifyTor Arne Vestbø2016-08-241-0/+1
| | | | | | | | | | Change-Id: I2b4d9b752f4b356cb3b0019dcfd4aab2edc30e94 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-224-4/+5
|\| | | | | | | Change-Id: I4f4ab05b2de67cd4b1d29b294b96a8c9ffb964b2
| * QTextHtmlParser: remove 317 unneeded relocationsMarc Mutz2016-08-222-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Same change as in QColor (d38f86e50b01c6dd60f5a97355031e08d6a47d18). relocs: -317 text: -6480B data: -5088B (optimized GCC 6.1 Linux AMD64 build) Change-Id: I647cd327b421caad45a19a14955de9e3aefaefab Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * QCssParser: remove 239 unneeded relocationsMarc Mutz2016-08-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Same change as in QColor (d38f86e50b01c6dd60f5a97355031e08d6a47d18). relocs: -239 text: +2248B data: -3872B (optimized GCC 6.1 Linux AMD64 build). The text size increase means we pushed the data into an immutable section. Change-Id: Iad10c877d4a4877878dded56a7ef1e14ff92c996 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * QXpmHandler: remove 657 unneeded relocationsMarc Mutz2016-08-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Same change as in QColor (d38f86e50b01c6dd60f5a97355031e08d6a47d18), but much more dramatic effect, due to 5x more elements in the array: relocs: -657 text: -3416B data: -10528B (optimized GCC 6.1 Linux AMD64 build) Change-Id: Ia266ab68f2d309743374ac2034a69f58bf556adf Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-183-3/+3
|\| | | | | | | | | | | | | Conflicts: src/plugins/platforms/xcb/qxcbintegration.cpp Change-Id: I2d71d06a55f730df19ace0dd3304238584a0497f
| * Do not disable subpixel rendering on compile timeAllan Sandfeld Jensen2016-08-181-1/+1
| | | | | | | | | | | | | | | | | | | | This is a runtime setting, as the user's freetype version can differ from the developer's, and freetype already safely handles it internally when not available. Task-number: QTBUG-55345 Change-Id: I26e73728196d60ae26e5f1919ecd0dadac393890 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| * Protect QImage::convertToFormat against null QImageAllan Sandfeld Jensen2016-08-171-1/+1
| | | | | | | | | | | | | | | | QImage may have a null d-pointer, and convertToFormat_helper was the only method not protected against it. Change-Id: Ibfe5b139e3922f2a0c8284c6ae1932c2150efc66 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * Fix rendering error in some animated gifsEirik Aavitsland2016-08-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The code for handling of the rarely used "restore to previous" frame disposal option would mistakenly clear the entire existing frame. It looks like this was a copy/paste mistake in the code; the intention obviously was to clear the newly created backingstore instead. This fixes the rendering of http://media1.giphy.com/media/9Jevgp0CgvAnm/giphy.gif Task-number: QTBUG-55141 Change-Id: I4d344b7733edd62346656154e215c21727f9b6bb Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Doc: Remove references to Windows CE in Qt GuiVenugopal Shivashankar2016-08-172-7/+1
| | | | | | | | | | | | | | | | | | The platform is not supported since Qt 5.7 Task-number: QTBUG-55331 Change-Id: I3a6027661c2d597158999fe9665e76b1db18a9de Reviewed-by: Martin Smith <martin.smith@theqtcompany.com> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-1320-58/+68
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.cpp src/corelib/io/qsettings.cpp src/corelib/itemmodels/qstringlistmodel.cpp tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp Change-Id: I1c6c306ef42c3c0234b19907914b19da706b4a03
| * Fix typo in QKeySequence docLiang Qi2016-08-121-1/+1
| | | | | | | | | | | | Task-number: QTBUG-55181 Change-Id: I70615a2b4b026a83f506df928a79c9e60543e655 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
| * Doc: Change instances of '(Mac) OS X' to 'macOS'Topi Reinio2016-08-1218-56/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As of version 10.12 (Sierra), the name of Apple's desktop operating system will be macOS. Change the occurrences where the Mac platform is discussed to use a macro \macos, which expands to 'macOS'. This helps with adapting to future renaming. Update the instructions on mac-specific Q_OS_* macro usage. Add a \target for the old 'Qt for OS X' topic to keep links working for other documentation modules that try to link with the old name. Change-Id: Id33fb0cd985df702a4ae4efb4c5fd428e77d9b85 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
| * Cache the current QOpenGLFramebufferObjectSérgio Martins2016-08-112-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | This doesn't cover FBOs bound directly with glBindFramebuffer(), but it's perfect to create a fast path for code we know uses QOGLFBO, thus avoiding expensive glGetIntegerv() driver calls. The use case is to use this in QSG24BitTextMaskShader::activate(), where we need to check if the current FBO is sRGB capable. Change-Id: I434eeeb7e6a3d16be9327315536ad7280245085d Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-104-2/+10
|\| | | | | | | Change-Id: I1a63523de158757964b6fb5ea026cf69a6c5ddcf
| * evdevtouch: Avoid crashing on exitLaszlo Agocs2016-08-102-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 26238aca8c442736f380eb523ef48468f892bdb7 causes double deletion of the QTouchDevice in case the post routine already cleaned up the list by the time the touch handler gets to do it. Just check the list of devices to see if the one we hold is still there. If not, the pointer is likely to be a dangling one so do nothing. This will avoid dying with bus error or similar on application exit. Task-number: QTBUG-51562 Change-Id: I50c1edee7405aad308274538219698388c2cc9f9 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * Added pointer check in QFontDatabase::loadJesus Fernandez2016-08-051-0/+1
| | | | | | | | | | | | | | | | | | CID 11131 (#1 of 1): Dereference after null check (FORWARD_NULL)46. var_deref_op: Dereferencing null pointer fe. Change-Id: Ifc0cd0b208db511516db93c3d0e0367299df6d80 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
| * Improve performance of QColor::name, now more than 4 times fasterDavid Faure2016-08-051-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Before: HexRgb: 0.00230 ms per iteration, HexArgb: 0.00290 ms per iteration After: HexRgb: 0.00051 ms per iteration, HexArgb: 0.00061 ms per iteration This showed up as a relevant optimization when profiling KIconLoader which uses QColor::name() as part of the key -- thanks to Mark Gaiser for the investigation and first suggestion of a solution. I have also seen customer code writing a replacement for QColor::name() because it was too slow to be used as a hash key. Change-Id: I009ccdd712ea0d869d466e2c9894e0cea58f0e68 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Doc: Fix saturation graphic for HSV color modelRainer Keller2016-08-084-0/+156
| | | | | | | | | | | | | | | | | | | | The text is correctly describing the gradient from gray to blue but the picture shows white to blue. Additionally including the SVG sources for creating the pictures. Change-Id: I608a239f4de9c2d3761196c44db024cc31ce441a Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* | Merge "Merge remote-tracking branch 'origin/5.6' into 5.7" into refs/staging/5.7Liang Qi2016-08-0511-30/+46
|\ \
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-0511-30/+46
| |\| | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp Change-Id: I6f3878b204464313aa2f9d988d3b35121d4d9867
| | * Remove unneeded ';' after some macrosKai Pastor2016-08-045-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | The unneeded ';' triggered warnings in pedantic compilation mode. Change-Id: Id2324823e138560bb25234306601253d7bbd713e Reviewed-by: Richard J. Moore <rich@kde.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| | * Fix 64-bit bilinear scaled image samplingAllan Sandfeld Jensen2016-08-041-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A constraint ensuring we do not sample beyond the current scan-line was missing in the SSE2 optimized sampling. Discovered with lancelot. Change-Id: Ib0ece8f8bfaa034733873dc5b8baaaad5d4c0380 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
| | * Doc: Fix references to Control, Meta key enumsKai Koehne2016-08-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Also make use of qdoc's \note command. Change-Id: I276300cfcfde06e82b04793dbf25df8ec73e9838 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
| | * QColor: remove 158 avoidable relocationsMarc Mutz2016-08-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of storing a pointer to a string, store the string in the RGBData struct. It's not as efficient as in other such cases, because one string is particularly long, but it's still more than acceptable. Text size increases slightly, but data size decreases a lot (can't say by how much, exactly, as I'm on a UBSan build). Change-Id: I1df2985fd1ebfccd84b48315d8d319dd9e25c8e7 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
| | * REG: Fix unwanted cache flush in Freetype engineEskil Abrahamsen Blomfeldt2016-08-011-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Freetype cache was almost completely disabled by 134c6db8587a8ce156d4fa31ffa62605821851b2 because after that change, the lockedAlphaMapForGlyph() function would no longer cut off early for empty glyphs like spaces, but rather go through all alpha map functions before it realized that there was nothing to render. This would in turn invalidate the cache for every empty glyph, causing all glyphs to be rerendered for every isolated word. This change adds back a cut off. This is only needed in the lockedAlphaMapForGlyph() function, since the superclass implementation of the other alpha map functions already contains a cut off for width/height == 0. [ChangeLog][Qt Gui][Text] Fixed a performance regression in Freetype engine that was introduced in Qt 5.5. Change-Id: I381285939909e99cc5fb5f3497fecf9fa871f29a Task-number: QTBUG-49452 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| | * QColor: Fix UB (left shift of negative number)Marc Mutz2016-07-311-14/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If hex2int(const char*) is called with invalid input, it is expected to return a negative value. However, it didn't check the return value of h2i() before attempting a left-shift on it, leading to UB when the first digit was already invalid. UBSan agrees: qcolor_p.cpp:55:23: runtime error: left shift of negative value -1 This is particularly worrisome as the function can be called with unsanitized input. Fix by checking each value for non-negativity, returning -1 early when errors are detected. Also port to QtMiscUtils::fromHex() and add some docs. Change-Id: I33dbc157ffb4fbfba27113a0a008eef35c1055f7 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * QRasterizer: fix UBs involving << with a negative LHSMarc Mutz2016-07-301-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Left-shifts of negative values are undefined in C++. In particular, they don't behave arithmetically. Reported by UBSan: qrasterizer.cpp:609:48: runtime error: left shift of negative value -640/-2240 qrasterizer.cpp:982:38: runtime error: left shift of negative value -2 Fix by using ordinary multiplication instead, because negative left-hand-side values don't look like they are an error. No errors were actually reported for a.y << 10, but I changed it nonetheless, since all a missing error means is that the test data didn't excercise this code path with negative Y values. Change-Id: I1fa9deca263f12206a3f7eab6ad875fc3242269d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>