summaryrefslogtreecommitdiffstats
path: root/src/gui
Commit message (Collapse)AuthorAgeFilesLines
* Avoid checking the fb status in every bindLaszlo Agocs2016-01-181-2/+0
| | | | | | | | | | | | | | | | On some drivers (e.g. NVIDIA, tested on Windows) the status check is apparently expensive. A simple FBO test app rendering into the FBO on every frame (and thus calling bind()) shows a 19-21% CPU usage. With the patch this gets reduced to 0.8-1%. The check is fairly useless too - whenever creating attachments, the status is checked, so d->valid is up-to-date. Task-number: QTBUG-50496 Change-Id: Ie9f0db34e5c2bc1a1141c734ca0b318419013c0d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* Lock qfontdatabase mutex in qt_fallbacksForFamilyAllan Sandfeld Jensen2016-01-151-6/+12
| | | | | | | | | | | When called from outside of qfontdatabase, the qfontdatabase mutex will not be locked upon entry to qt_fallbacksForFamily, so we need to add it to the exported version. Change-Id: I16a21708d7cca15730c12de3dbeeaab13ffbd315 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Handle RGB30 formats in OpenGL backing-store integrationAllan Sandfeld Jensen2016-01-152-19/+83
| | | | | | | | Optimizes composition on platforms that may use 10-bit per color channel formats. Change-Id: Ib303c391d47795c79a4ba55d78dbb1c3c702d90a Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Doc: add missing semi-colonThiago Macieira2016-01-151-1/+1
| | | | | | Change-Id: I408dcb81ba654c929f25ffff14291c57198e7367 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* Optimize OpenGL binding of ARGB32PM backing storeAllan Sandfeld Jensen2016-01-144-19/+60
| | | | | | | | | | 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 shortcut modifiers not being propagated after c7e5e1d9eTor Arne Vestbø2016-01-121-1/+3
| | | | | | | | | | | The code-path used by non-OSX platforms were not passing on the native scan-code, virtual key, and modifiers, breaking QKeyMapper::possibleKeys in the process. Task-number: QTBUG-50360 Change-Id: Idc36380a234f0a37d016dbeaca594aeb82c496d2 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
* Fix reentrancy regression in QShortcutMap after c7e5e1d9eTor Arne Vestbø2016-01-121-2/+6
| | | | | | | | | | | When closing a popup dialog using a shortcut, when the popup was originally opened using a shortcut, the closing-shortcut would interfere with the state of the first shortcut, and we ended up sending a key event for the original shortcut. Task-number: QTBUG-50360 Change-Id: I62e5ddb9ca43b28519ede629775bc0d7598dccc4 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Fix a few container detachmentsSérgio Martins2016-01-101-1/+1
| | | | | Change-Id: I018a1fe4bdbbe42b683793d7ddbf19f464d6e3b0 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Use backing store formats with alphaAllan Sandfeld Jensen2016-01-083-51/+38
| | | | | | | | | | | | | We depend on being able to punch holes in the backing store when integrating with FBO elements. To do that we need a format with an alpha channel. This was only working previously because RGB32 didn't mask when filling or when converting to ARGB32_PM, but other formats didn't. Also unifies the logic for getting alpha versions of QImage formats. Task-number: QTBUG-50281 Change-Id: Ied1325f60e2b67d9ea2dfa9701b06fc2231ebfca Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.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>
* doc: correct documentation of QT_AUTO_SCREEN_SCALE_FACTOR env varShawn Rutledge2016-01-071-1/+1
| | | | | Change-Id: I4fa57279b23911893a615fe8a3ce9854d0fec971 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* QtGui: Don't set screen to a child window when processing screen eventsBłażej Szczygieł2016-01-071-4/+6
| | | | | | | | | Setting a screen to a child window causes a warning message. This patch prevents the debug message by catching incorrect behavior made by QPA earlier. Change-Id: Idf3ac02290a18afc134f19c2b91348dc009ca4ca Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* QtGui: Fix obtaining the top level window at a pointBłażej Szczygieł2016-01-071-10/+30
| | | | | | | | | | Find the top level window on the primary virtual desktop first to avoid obtaining a window which doesn't belong to the primary virtual desktop when screen geometry is similar. Change-Id: I78fdfa0b5146d0ba9b912338adeb612c102c4ac3 Reviewed-by: Adam Majer <adamm@zombino.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* QtGui: Don't set a screen to a child windowBłażej Szczygieł2016-01-061-7/+9
| | | | | | | | This is a partial revert of eaa3a9d0108cdf692f1686cafefb7b834f0e5af6 Task-number: QTBUG-50081 Change-Id: Ic3dc4daa90d7a968a4ebf45d3029c99a12985686 Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* Avoid unnecessary detaching of the pending deletions list.Volker Krause2016-01-061-3/+3
| | | | | | | | | | | This code seems to be hit three times per frame in a hybrid QQ2/Qt3D app, quickly generating thousands of allocations here via the detach in begin(). Heaptrack confirms they are all gone now. Change-Id: I7d09f3f5c2b24a2590b701216715055751306e82 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Don't detach QGradientStopsSérgio Martins2016-01-051-1/+1
| | | | | Change-Id: I1ae84d0ae825e9fb474d4fab45b0c475a3878b25 Reviewed-by: David Faure <david.faure@kdab.com>
* QOpenGLTexture: fix target for compressed texturesMauro Persano2016-01-041-138/+70
| | | | | | | | | | | Trying to set data for a compressed cubemap texture face fails, because the code incorrectly tries to bind to a cubemap face target. This was already fixed for uncompressed textures. Instead of duplicating the code, moved the texture binding/unbinding code to a RAII class. Change-Id: I8f1cb7fc661b919200f85c3465d6e6e3c22d0871 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix QPainter::rotate() documentationMitch Curtis2016-01-041-1/+1
| | | | | Change-Id: I5d11f84181cad9be644e850c83459b47ec2f2f15 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* Fix crash because of NULL screen in QXcbWindowBłażej Szczygieł2016-01-041-8/+6
| | | | | | Change-Id: If7bbe3ad1656dadcb098bcd3ece2e7b064eeb44d Task-number: QTBUG-50081 Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* Fix broken permission to mode mappingFrank Meerkoetter2015-12-191-3/+3
| | | | | | | Fixes coverity CID154258. Change-Id: Ia958d24c533c4f0077abd363ee4c041cc2cdb6f0 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Use Q_CONSTRUCTOR_FUNCTION instead of doing the same manuallyAllan Sandfeld Jensen2015-12-172-23/+7
| | | | | | | | 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>
* QOpenGLTexture: fix the number of faces returned by faces()Giuseppe D'Angelo2015-12-161-0/+2
| | | | | Change-Id: I7bf08eee357fb9641ff9118edcf97809f98605b7 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QOpenGLTexture: check textureId for knowing whether a texture was createdGiuseppe D'Angelo2015-12-161-1/+1
| | | | | Change-Id: I0775ad9538a7793dc6628abe4556404634ae0462 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QOpenGLTexturePrivate: remove unused member variableGiuseppe D'Angelo2015-12-161-1/+0
| | | | | Change-Id: I4d897c522087654649547c0ca4750ba4dbfa5cbf Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Cache font fallback families to reduce startup timeKonstantin Ritt2015-12-161-3/+52
| | | | | Change-Id: I593708d76d513028ba1b59621b83cbc32e63d4e6 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Use the cached font fallback families list in QFont::defaultFamily()Konstantin Ritt2015-12-151-2/+4
| | | | | | Change-Id: Iba1d9db05f7a09aabb81d0429e6081cd7710d381 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@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>
* xcb: Use a placeholder QScreen when there are no outputs connectedBłażej Szczygieł2015-12-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | If no screens are available, windows could disappear, could stop rendering graphics, or the application could crash. This is a real use case in several scenarios: with x11vnc, when all monitors are physically disconnected from a desktop machine, or in some cases even when the monitor sleeps. Now when the last screen is disconnected, it is transformed into a fake screen. When a physical screen appears, the fake QScreen is transformed into a representation of the physical screen. Every virtual desktop has its own fake screen, and primary screens must belong to the primary virtual desktop. It fixes updating screen geometry on temporarily disabled screens in the middle of the mode switch. Expected results: Windows don't disappear, the application doesn't crash, and QMenu is displayed on the appropriate screen. This reverts patch 51ada7734ad780178ecced11e0dff454dfc2e5f2 Change-Id: I6e8eb682b0c8425d08ffdaecbd4c6c7700c914b4 Task-number: QTBUG-42985 Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* QPlatformTheme: added TabButtonFont and GroupBoxTitleFontLiang Qi2015-12-101-0/+2
| | | | | | | Which is needed by Qt Labs Controls. Change-Id: I2f91a1cbe8218170f894189b56f3fef77207eaec Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Register QPA Menu, Dialog & SysTray enums & flagsJ-P Nurmi2015-12-093-0/+21
| | | | | | | | | | This allows QML Menu, Dialog & SystemTrayIcon to use the same enums without having to duplicate them. Change-Id: I1401583d3ae2ef07cdc795d2765fba07c9b30f2f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@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-092-0/+4
| | | | | | Task-number: QTBUG-49655 Change-Id: I7a5d08f681a7d87709aac745154730764040e922 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* QPlatformWindow::initialGeometry(): Pass screen when scaling.Friedemann Kleint2015-12-071-15/+16
| | | | | | | | | Otherwise, the window may up outside the display area when centering on a secondary screen and the primary screen has a different scale factor. Task-number: QTBUG-49803 Change-Id: I91ec7c5348722a90012f80a247e662e96bcbb391 Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
* Add QStyleHints::showIsMaximized().Friedemann Kleint2015-12-072-1/+19
| | | | | | | | | | | | | Expose QPlatformIntegration::ShowIsMaximized similarly to QPlatformIntegration::ShowIsFullScreen. This allows for applications to adapt their UI to mobile/desktop accordingly. Change-Id: Ic14d16fde11d7d2740b2f4092ae12e88a2f522fd Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Optimize qt_findAtNxFile by reducing the amount of allocationsOlivier Goffart2015-12-071-4/+5
| | | | | Change-Id: I94a2b40933f9469f509a4cc54d68138696704ba2 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* Android: Implement QInputMethod::keyboardRectangleOlivier Goffart2015-12-071-0/+3
| | | | | | | | | | | | | | | | | We can use getWindowVisibleDisplayFrame to know the height on the keyboard, and we can use getLocationOnScreen to find out how much the view is scrolled. Since onPreDraw is always called when the view is scrolled or when the keyboard appears or disapear, we can call the native functions from there. This is not working for floating keyboards. [ChangeLog][Android] Implemented QInputMethod::keyboardRectangle Task-number: QTBUG-40731 Change-Id: I7848eb34fece410b29a06bf0bbb2313112fffa68 Reviewed-by: Samuel Nevala <samuel.nevala@intopalo.com> Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* Initialize function tables without QGuiApplicationAllan Sandfeld Jensen2015-12-075-16/+28
| | | | | | | | | | | | | 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>
* Respond with a sound for certain message boxes on windowsJan Arve Saether2015-12-041-11/+10
| | | | | | | | | | | | | | | This was a regression (it worked in 4.8) that was probably introduced by the refactoring of the accessibility framework in Qt 5. Now, QPlatformAccessibility::notifyAccessibilityUpdate() is called regardless of isActive(), so its the responsibility of each implementation of notifyAccessibilityUpdate() to check for isActive() where it matters. Task-number: QTBUG-33303 Change-Id: I0d18f8c1890ef679460408b05e704712b886bf7c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
* QImage pixelColor and setPixelColor must use unpremultiplied QColorAllan Sandfeld Jensen2015-12-041-8/+22
| | | | | | | | | QColor always uses unpremultiplied alpha, but the new QImage methods were based on the QRgb versions which might be either. This patches fixes the two new methods so they treat QColor alpha correctly. Change-Id: I78a5b875ad4e78ad7fde3b811c6187482b4f6d15 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Doc: Clarified QTextTable::mergeCells() documentationNico Vertriest2015-12-031-2/+2
| | | | | | Task-number: QTBUG-37928 Change-Id: I8d3ae3b540f9483d1e93d4c8135f777dea13f967 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* Freetype font engine: Restrict bold depending on OS2 weight class.Friedemann Kleint2015-12-031-2/+6
| | | | | | | | | Limit setting bold to weights <=750. Task-number: QTBUG-48922 Change-Id: Id38b636698e58b0686dda9711ee1b3426a3b45b9 Reviewed-by: Gunnar Roth <gunnar.roth@gmx.net> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Round advances if subpixel position not supportedEskil Abrahamsen Blomfeldt2015-12-021-5/+5
| | | | | | | | | | | | | | | | | Due to kerning and other OpenType features, it's possible that the advances from the shaping process are fractional, but this gives uneven glyph positioning for font engines that don't support subpixel positioning (since the glyph will not match the expected position, some gaps will look too large and some too small). To match how e.g. GDI renders this, we round the advances before setting the glyph positions for engines that do not support subpixel positions. [ChangeLog][Windows] Fixed uneven kerning for some fonts. Task-number: QTBUG-48546 Change-Id: Ic00dc402abf7149aab6bf9b05b42827b805c1a15 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Fix possible null pointer dereferences.Jake Petroules2015-12-021-0/+8
| | | | | | | | This follows up 130c2baa9376dcf525916620294bd9996bdf41f3. Change-Id: I2f6c9b4f995af427cec9a2162b782039debf8564 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* Update QHighDpiScaling internal documentationMorten Johan Sørvig2015-12-021-24/+113
| | | | | | | | | | | Expand section on coordinate systems. Document the AA_EnableHighDpiScaling / AA_DisableHighDpiScaling flags added in commit add58ed. Add some notes for platform plugin work. Change-Id: Ie6fe2d818a88ba784c0ee675fabbd3fc04d64bf1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* Avoid dynamic switching between backingstore composition pathsLaszlo Agocs2015-12-011-1/+2
| | | | | | | | | | | | | | | | | | Make it opt-in because doing a normal backingstore flush does not seem to work on Cocoa once we use OpenGL on the window. Windows and Linux should be able to cope with this. This means that platforms outside Windows and Linux will continue to have the problem of having GL-based compositing enabled for ever after having a QOpenGL/QuickWidget shown in the window once, but the issue is most prevalent on Windows anyway, OS X machines can deal with OpenGL better in general. Task-number: QTBUG-49172 Change-Id: I30fd2efa95cc4f6eed9cf7f7613d0750355c775c Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com> Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* Call setLayoutDirection() in QGuiApplicationPrivate::init() if not called beforeAlbert Astals Cid2015-11-301-3/+8
| | | | | | | | | | | | | | | | | | | | | Without this patch, setLayoutDirection() is called only by LanguageChange event handling, which triggers only upon installing, removing, or clearing QTranslators. This caused two problems: * If the QTranslators are installed in a Q_COREAPP_STARTUP_FUNCTION the event is lost since the QGuiApplication is still not there. * If the application doesn't use QTranslators at all, i.e., uses gettext, some other translation system, or because it has no messages at all, setLayoutDirection() is never called and the layout direction is wrong. The initialization of layout_direction has been changed from Qt::LeftToRight to Qt::LayoutDirectionAuto but that has no impact since QGuiApplication::layoutDirection will make sure Qt::LeftToRight is returned if layout_direction has still not been set. Change-Id: Ic60fe9a318c8afe1c503e3796ec54cfc687e7164 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Fix conversion QVariant(QColor) to QString.Jędrzej Nowacki2015-11-301-3/+6
| | | | | | | | | | | | | QVariant was using QColor::name() to convert a color to string, which by default loses alpha value. The patch is fixing the problem by always including the alpha value in the string when required. [ChangeLog][Core][Variant] QVariant(QColor)::toString() uses QColor::HexArgb format when the alpha component is different from 1. Task-number: QTBUG-37851 Change-Id: I887460c1ea151180ba99d64dd873ba9d6e2268f2 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* 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>