summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.6.0' into 5.6Liang Qi2016-02-152-8/+28
|\ | | | | | | Change-Id: I0b190005377a23a91da3563428e223b8a3b18333
| * Support arbitrary strides in the QPlatformBackingStore compositorLaszlo Agocs2016-02-051-4/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise platform backingstores providing QImages with extra pixels would break horribly. The only such platform is wayland for now. Previously the need to support this case was masked by the RGBA8888 image conversion that happened always with wayland due to its ARGB32_Pre format. With the recent improvements this is not done anymore and so the problems became apparent. Task-number: QTBUG-50894 Change-Id: I27d7a1c8e25d152ca1227af1e2c38f7d4b6acbab Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
| * Scale offset as well on QBackingStore flushMorten Johan Sørvig2016-02-051-1/+2
| | | | | | | | | | | | | | | | | | | | | | Also use the target window ("win") as context instead of d->window. Change-Id: I5b0fa3bb857526e4a4bc9c5e44670593da1dfe7c Task-number: QTBUG-50487 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com> Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
| * Fix clipRect interpretation in composited backingstoresLaszlo Agocs2016-02-011-3/+5
| | | | | | | | | | | | | | | | Empty clipRect means "clip away completely", not "no clipping". Task-number: QTBUG-50719 Change-Id: I6a9dd66130716a921fe9fc245582274e3c9718fe Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* | QtGui: Use QImage::constBits()/constScanLine() in non-const contexts.Friedemann Kleint2016-02-133-7/+7
| | | | | | | | | | | | | | | | | | Prevent potential detaching by using constBits()/constScanLine() instead of bits()/scanLine(). Change-Id: If03f8d4d3b8ed4c07aed5eff7f580e57ca771919 Reviewed-by: Gunnar Sletta <gunnar@sletta.org> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | QtGui: Avoid rgba64->rgba32 conversion on every pixel in gradientBłażej Szczygieł2016-02-123-15/+36
| | | | | | | | | | | | | | | | | | | | | | Convert rgba64 color table to a new rgb32 color table only once. Use this cache when required. This patch can 2x speed up gradient painting using 32bit color format. Task-number: QTBUG-50930 Change-Id: I9212e01e397c2e0127cdf3070cc49880a2d8df88 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | Reduce allocations by using reserve()Sérgio Martins2016-02-071-3/+5
| | | | | | | | | | Change-Id: If34fa53402985f6b3c5e7217bce4a1177af835b6 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Fix rounding error in fetchTransformedBilinearAllan Sandfeld Jensen2016-02-021-2/+4
|/ | | | | | | | | | | | | To calculate the real count we need to use the actual fixed point increment and can not use the floating point value increment wass based on since it might round differently. Includes auto-test by Gabriel de Dietrich. Task-number: QTBUG-50153 Change-Id: Ia973088f361c90370fa20bac14a4b8f373b5d234 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Fix tlw source rect transformation for backingstore blit.Dyami Caliri2016-01-241-1/+1
| | | | | | | | | The srcRect is already in device window coordinates. Converting it again via deviceRect(QRect, QWindow) causes it to be overly large. Task-number: QTBUG-50613 Change-Id: Iaae390499c0d1add842bde6eec22fb07c8de663b Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Handle RGB30 formats in OpenGL backing-store integrationAllan Sandfeld Jensen2016-01-151-10/+38
| | | | | | | | Optimizes composition on platforms that may use 10-bit per color channel formats. Change-Id: Ib303c391d47795c79a4ba55d78dbb1c3c702d90a Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Optimize OpenGL binding of ARGB32PM backing storeAllan Sandfeld Jensen2016-01-142-10/+31
| | | | | | | | | | Detect premultiplied backing store and upload it without conversion and adjust blend to not multiply alpha again. Task-number: QTBUG-50381 Change-Id: I51939c4f82fbb0c48eaca6e2475bf4cf3722bc2d Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Fix a few container detachmentsSérgio Martins2016-01-101-1/+1
| | | | | Change-Id: I018a1fe4bdbbe42b683793d7ddbf19f464d6e3b0 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Fix offset and size for native child rtt widgetsLaszlo Agocs2016-01-071-11/+7
| | | | | | | | | | | | | | | Render-to-texture widgets that are native children may have a non-zero offset telling the position within the top-level widget. The size is usually different (smaller) than the tlw's size as well. An unfortunate optimization attempt led to ignoring the size for native children with offset (0, 0). This resulted in interesting rendering artifacts whenever such widgets were placed in the top-left corner of the toplevel. This is now corrected. Task-number: QTBUG-48130 Change-Id: If449610c3f3333cb73ae149efaefd7ef42953951 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* Don't detach QGradientStopsSérgio Martins2016-01-051-1/+1
| | | | | Change-Id: I1ae84d0ae825e9fb474d4fab45b0c475a3878b25 Reviewed-by: David Faure <david.faure@kdab.com>
* Fix QPainter::rotate() documentationMitch Curtis2016-01-041-1/+1
| | | | | Change-Id: I5d11f84181cad9be644e850c83459b47ec2f2f15 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* Use Q_CONSTRUCTOR_FUNCTION instead of doing the same manuallyAllan Sandfeld Jensen2015-12-171-13/+6
| | | | | | | | Use the macro we have that does exactly what we want without the boiler plate code. Change-Id: I25c67a71f83f91f50128c8a54033ee53ad28e88a Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Don't detach the color table vectorSérgio Martins2015-12-131-2/+3
| | | | | | Change-Id: Iec7814b0aca74ddc9744af358561b18b96d7a266 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Remove iOS workaround for pixman drawhelpersTor Arne Vestbø2015-12-121-7/+2
| | | | | | Change-Id: I8636993571b04d8cda74708777ba3ef2bac09fb5 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* iOS: Enable non-pixman NEON drawhelpers for both 32 and 64-bitTor Arne Vestbø2015-12-123-11/+13
| | | | | | | | | | | | The pixman drawhelpers are implemented using GAS syntax, which the Clang assembler doesn't handle, nor do they work on 64-bit ARM, so we disable them selectively. They are only used for 16-bit surfaces anyways, so it not a big deal on iOS. (cherry picked from commit 49568df95450733dc4c273945e5ced218132c123) Change-Id: I70848981c794739d40a6a2d9a537307bc80d61a6 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* Fix debug operator for QRegion.Friedemann Kleint2015-12-091-6/+27
| | | | | | | | | | | | | | | Use QDebugStateSaver, drop the multiline format, check for null, empty and output rectangular regions as: QRegion(0,0 252x188) and complicated regions as: QRegion(size=4, bounds=(0,0 278x262) - [(0,0 278x13), (0,13 13x188), (265,13 13x188), (0,201 278x61)]) Change-Id: I82b8f58af08f7128e6cf2c2c8b06c4684fc6a9c8 Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Reduce flushes with repaint() when GL-based compositing is activeLaszlo Agocs2015-12-091-0/+2
| | | | | | Task-number: QTBUG-49655 Change-Id: I7a5d08f681a7d87709aac745154730764040e922 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* Initialize function tables without QGuiApplicationAllan Sandfeld Jensen2015-12-072-3/+16
| | | | | | | | | | | | | QImage can be used without QGuiApplication, but wihout QGuiApplication the accelerated methods would not be used. This patch changes the initialization of the QtGui function tables to happen in static object constructors on QtGui load, instead of in the QGuiApplication init. Change-Id: Ib58982fbc50fd79122352d021d93a3c99aca5043 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Enable AArch64 versions of ARGB32 NEON drawhelpersAllan Sandfeld Jensen2015-11-303-25/+99
| | | | | | | | | Fix the ARGB32 NEON-optimized drawhelpers so they also build on AArch64. The RGB16 NEON-drawhelpers are not converted as they use more assembly. Change-Id: I8b75fadf5bad74360a2ab6aec9a6bf50df80c1b9 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* QtBase: remove explicit function info from qWarning() etcMarc Mutz2015-11-281-2/+2
| | | | | | | | | | | This information is already registered by the QMessageLogger ctor. Where, by dropping the << Q_FUNC_INFO in ostream-style qDebug(), only a string literal remained, converted to printf-style qDebug() on the go. Change-Id: I3f261c98fd7bcfa1fead381a75a82713bb75e6f3 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-11-271-2/+9
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/network/socket/qnativesocketengine_p.h src/network/ssl/qsslsocket_mac.cpp src/network/ssl/qsslsocket_mac_p.h src/widgets/kernel/qwidget.cpp Change-Id: I39592cb37d710dfaf8640769ba3c1b637927d7f4
| * Remove incorrect assertion from the backingstoreLaszlo Agocs2015-11-261-5/+8
| | | | | | | | | | | | | | | | | | | | The ifdef gave an impression of the code path being hit only when texture-backed widgets are present and OpenGL-based compositing is active. This is false. Asserting on having a context current is wrong (as shown by autotests on the 5.6 branch). Change-Id: I2539f0aac75b26597f49f63edcd9580428be79b7 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
| * Do not leak textures from the backing storesLaszlo Agocs2015-11-231-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Neither the default nor the eglfs-specific backingstore release the OpenGL textures that are in use when render-to-texture widgets are involved. The result can be fatal on embedded devices that run out of GPU memory at after showing and closing dialogs and popups a certain number of times. Task-number: QTBUG-49363 Task-number: QTBUG-49399 Change-Id: Ia7471b037f147bcca0a4f1db5808ca348e230547 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
* | Detect NEON on AArch64Allan Sandfeld Jensen2015-11-263-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | The __ARM_NEON is the standard define for NEON instructions support __ARM_NEON__ is only legacy, and specifically not defined in AArch64 builds, which causes us not to detect NEON support there. The NEON assembler files doesn't build with AArch64, so the NEON drawhelper methods must be excluded for now. Change-Id: Ie32f855bde94ee7efd8a8ddb7766c931778e729b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Fix undefined behavior in qRgba().Tilo Nitzsche2015-11-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | Shifting a signed integer that overflows is undefined behavior. All masks were changed to unsigned in qRgb and qRgba. While the alpha value is enough to fix the undefined behavior, Visual C++ generates slow code if not all of those constants are unsigned. Change-Id: Ia0ec3e9464088495173b4ad9c2e37a49e6f8e987 Task-number: QTBUG-49595 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Support mixing native child widgets with texture-based onesLaszlo Agocs2015-11-191-13/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently QOpenGLWidget and QQuickWidget do not support having native child widgets inside the same top-level window. In some cases this is inevitable, f.ex. multimedia may require native windows when used from widget apps. winId() calls made for various (valid or invalid) reasons are also problematic. There are no blockers for supporting this setup, however. By storing multiple texture lists (one for each subtree where the root is a native widget), adding the missing markDirtyOnScreen calls, letting each native widget access the correct texture list (i.e. the one corresponding to its children) when they are (separately) flushed, and fixing composeAndFlush() to take the update region and the (native child) offset into account, it can all be made functional. The change also fixes the issue of keeping GL-based compositing enabled even after all render-to-texture widgets in the window become hidden. Due to the changes of how such widgets are gathered, composeAndFlush() is not invoked anymore when no such widgets are discovered for a given native parent. This is great since having compositing enabled infinitely is an issue for applications like Qt Creator that implement certain views with QQuickWidgets but cannot afford the cost of texture uploads in other places (e.g. for the text editor) on slower machines. The openglwidget manual test is greatly enhanced to test various situations (MDI, scroll areas, tab widgets, QOpenGLWidget as native child, QOpenGLWidget with non-tlw native parent, etc.) Task-number: QTBUG-48130 Task-number: QTBUG-49172 Change-Id: Iad098359c8bcf749f01c050da0853415e1550eda Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* | qdrawhelper.cpp: Fix constexpr build with MSVC 2015 Update 1Thiago Macieira2015-11-181-7/+7
| | | | | | | | | | | | | | error C2397: conversion from 'uint' to 'uchar' requires a narrowing conversion Change-Id: Ic1b9e0a78b2faa5a0ae4e6de33ab2ee4b654af5f Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Set private inline QRgba64 methods always inlineAllan Sandfeld Jensen2015-11-061-6/+6
| | | | | | | | | | | | | | By setting them always inline we ensure they will never generate symbols. Change-Id: I2c815c4fe2cb498187656e0b25ef4499258885ff Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* | QDataBuffer: disable copy special member functionsMarc Mutz2015-10-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | The compiler-generated ones would break class invariants. This internal class so far isn't copied. This patch makes sure that it stays that way. Change-Id: I8bf75058edaf2adf148ae9edff4bf4e9a3b3368d Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | src/gui/painting/painting.pri: add missing qdatabuffer_p.hMarc Mutz2015-10-291-0/+1
| | | | | | | | | | Change-Id: I40ae6beb14058948030e63a2535ff72a6b8072c1 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | QPathSegments::Intersection: reduce struct size 24 -> 16 bytesMaks Naumov2015-10-262-4/+3
| | | | | | | | | | | | | | Only for systems where qreal is double(8 bytes). Change-Id: I3fd6b5d4279c41102ead24eef287bb37847398c1 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Fix alignment in qConvertARGB64PMToA2RGB30PM_sse2Frederik Gladhorn2015-10-231-2/+1
| | | | | | | | | | | | | | | | _mm_load_si128 requires 16 byte alignment. This crashes on 32 bit Windows builds. Change-Id: Ib6c30eba726747bbab56467eada820521981a80c Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Compile the 64-bit version of some code on all 64-bit processorsThiago Macieira2015-10-231-2/+2
| | | | | | | | | | | | | | This is true for ILP32 on x86-64, IA-64 and AArch64. Change-Id: I1d0f78915b5942aab07cffff140f9d4c277bb5d4 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | Convert some QDateTime::currentDateTime() to currentDateTimeUtc() (I)Marc Mutz2015-10-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The latter is much faster as it doesn't have to deal with time zones. This change handles the trivial ones: Either the call to currentDateTime() is immediately followed by a call to toUTC() or toTime_t(). The latter is much faster on UTC QDateTimes, too. Credits to Milian Wolff, from whose QtWS15 talk this advice is taken. Change-Id: I872f5bbb26cbecedc1e5c0dbee4d5ac2c6eb67ee Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* | Respect QPen::dashOffset when generating PDFLars Knoll2015-10-221-3/+3
| | | | | | | | | | | | Change-Id: I26de1cd4a14d1b8978be6d0377cb2cba573fc82a Task-number: QTBUG-47164 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | Fix warning message to match the function signatureLars Knoll2015-10-221-2/+2
| | | | | | | | | | | | Change-Id: Ie21d63e29351dae9a52998e3d1068500e502ec5a Task-number: QTBUG-46693 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | Fix alignment issues on 32 bit in qConvertA2RGB30PMToARGB64PM_sse2 and ↵Frederik Gladhorn2015-10-221-5/+10
| | | | | | | | | | | | | | | | | | | | | | qConvertARGB32PMToARGB64PM_sse2 On 32 bit platforms the pointers may end up being 4 byte aligned. Happens with MSVC on 32 bit Windows. _mm_store_si128 is documented to require 16 byte alignment. Change-Id: I80737fedf9e7f436a51a83924117cc0bc63017cc Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* | Avoid image copy in toTexture() on GLES 3.0 as wellLaszlo Agocs2015-10-141-12/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default backingstore implementation is now cleaned for ES_2 ifdefs. All the checks are now done at runtime and ES 3.0+ is included as well for the efficient, QImage::copy()-less path. For embedded a customized backingstore is used so the change has to be done separately there. This should result in a slight improvement for QOpenGLWidget/QQuickWidget when running on GLES 3.x. Task-number: QTBUG-37624 Change-Id: I107330c25a993c5cdcd92e4ebdc17ae172a03da8 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* | Libraries: Fix single-character string literals.Friedemann Kleint2015-10-131-1/+1
| | | | | | | | | | | | | | Use character literals where applicable. Change-Id: I8e198774c2247c1cc1d852a41b59b301199b7878 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | DirectFB: Use correct pixel format for Texture Glyph CacheAndy Nichols2015-10-121-2/+2
| | | | | | | | | | | | | | | | QImage::Format_Indexed8 -> QImage::Format_Alpha8 Change-Id: I7faa7c9d2cb20306f63a2522e7fa78736b9ee583 Task-number: QTBUG-47490 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-10-022-2/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/doc/src/qmake-manual.qdoc src/corelib/tools/qstring.h src/gui/image/qimagereader.cpp src/network/access/qnetworkaccessmanager.cpp src/tools/qdoc/doc/examples/examples.qdoc src/widgets/accessible/qaccessiblewidgetfactory_p.h src/widgets/doc/qtwidgets.qdocconf Change-Id: I8fae62283aebefe24e5ca4b4abd97386560c0fcb
| * Fixed pageLayout, pageSize, pageOrientation, pageMargins for QPdfWriterOliver Wolff2015-09-221-1/+2
| | | | | | | | | | | | | | Task-number: QTBUG-46887 Change-Id: I8f1497a8b7ff13213879de01fcdfcabfdd471874 Reviewed-by: Gunnar Sletta <gunnar@sletta.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
| * Another fix of cosmetic QPainter::drawPolyline()Eirik Aavitsland2015-09-011-1/+2
| | | | | | | | | | | | | | | | | | | | At the edge of the view, a line segment could end up as not producing any pixels even if not clipped by the floating-point clip routine. Make sure the starting point for the next line is still updated correctly for any significant segment lengths. Change-Id: I381a4efb81ce6006f3da4c67abf279aea79e4663 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | Fix missing "We mean it" in qtbase private headersThiago Macieira2015-10-011-0/+11
| | | | | | | | | | Change-Id: I42e7ef1a481840699a8dffff1408dfd4fd9c8e32 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Use a power of two division factorAllan Sandfeld Jensen2015-09-241-1/+1
| | | | | | | | | | | | | | | | | | Using a power of 2 instead of power of 10 means the result of the division can be accurately represented as a floating point instead of being an approximation that could lead to rounding errors. Change-Id: I8910c06113ec6b69c60ff95d59894bfb56133186 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* | Fix up QOpenGLWidget transparency supportLaszlo Agocs2015-09-241-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The glColorMask call was troublesome. In addition, the Qt::WA_TranslucentBackground was misinterpreted and recommended misleadingly in the documentation. The hellogl2 example's --transparent argument was disfunctional in practice. Replace glColorMask with glBlendFuncSeparate. The hellogl2 example and the docs are now corrected wrt enabling semi-transparency in a QOpenGLWidget that is not a top-level (which is the most common case). Task-number: QTBUG-47276 Change-Id: I6f40e732d455f5efcf158649ac9a52ff9f240e85 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>