Commit Graph

41637 Commits

Author SHA1 Message Date
Alexandru Croitor
82ee87b7b8 CMake: Fix androiddeployqt support when using add_library MODULE
The recent change to support android with CMake assumes that the user
project will have add_library(foo SHARED), and sets the
CMAKE_SHARED_LIBRARY_SUFFIX_CXX variable to modify the final library
name to contain an ABI suffix.

This did not work when using add_library(foo MODULE), and
androiddeployqt failed saying it can't find the application binary.

Make sure to apply the ABI suffix to MODULE targets. Also cover
the suffix to be added regardless if the language used for compiling
the SO is C or C++.

Amends 52c799ed44

Change-Id: Ic44d67e33a123bd0104d98b368ceda0844474980
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2019-10-29 08:57:44 +01:00
Andy Shaw
11acbc2c99 sqlite: Update to v3.30.1
Since the patch applied previously is no longer required, we have
removed that too.

[ChangeLog][QtSQL][sqlite] Updated to v3.30.1

Fixes: QTBUG-79416
Change-Id: Ifc3fcc6e1768f80e97a5e0ab4b2aeabddf2ced9d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-29 09:17:41 +02:00
Mitch Curtis
d86192e5ba QFontDatabase: improve logging output
Log the style name, add more descriptions of what's being logged.

Before:

Adding font "Lucida Grande" 50 QFont::StyleNormal 0 aa true fixed false

After:

Adding font family "Lucida Grande" stylename "Regular" weight 50 style QFont::StyleNormal pixelSize 0 antialiased true fixed false

Change-Id: I138f1b9f41dc41c528c830d81f8018fc16561631
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-28 15:42:29 +01:00
Eskil Abrahamsen Blomfeldt
c62dbc0c02 no-thread: Add dummy implementations for stackSize functions in QThread
We recently added a call to setStackSize() in the QML thread, which
revealed that the dummy implementation for this function was missing
in no-thread builds.

Fixes: QTBUG-79571
Change-Id: Ibabb48d9cba73afda0842642045a2961e65523f9
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-10-28 13:29:32 +01:00
Christian Ehrlicher
5b22dc71a3 QGraphicsItem: disable deprecated warnings during compilation
The previous commits which deprecated the function forgot to add
QT_WARNING_PUSH/QT_WARNING_POP around the affected code.

Change-Id: I042a2bcd40afe2e5fe517954be26a02fd048b563
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-10-28 13:09:40 +01:00
Morten Johan Sørvig
9cb823cd0f QTestLib: basic WebAssembly support
Disable the crash signal handler. This makes it possible
to run auto-tests in the browser.

Long-running tests may cause the browser to interrupt
or display the “a web page is slowing down your computer”
message, or not produce any console output while the
test is running.

Change-Id: Ifd53b744bd3652abfb466b78992ce2371eca2536
Task-number: QTBUG-68504
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2019-10-28 11:52:57 +00:00
Qt Forward Merge Bot
08f90adffd Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
	src/corelib/serialization/qjson_p.h

Change-Id: I83cea141a4de8b3998478bfded84ca9029f7a2a9
2019-10-28 10:50:03 +01:00
Tor Arne Vestbø
4b346aedf8 macOS: Deliver update requests even when view or layer needs display
This was a workaround to prevent visual artefacts from flushing GL
during window resizing, but now that we skip the flush entirely in
this situation we don't need to limit the update request delivery.

Change-Id: I84bd48e4e2fc5a03e9d27d5f9b4b32b8098e56a5
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-10-28 11:48:40 +02:00
Tor Arne Vestbø
dcbe25bbbb macOS: Only skip screen reconfigure if primary screen changed
Change-Id: Ia5d208ace5086e8e92f95f859383773894a18768
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-10-27 20:19:01 +01:00
Tor Arne Vestbø
3ee634d520 macOS: Extend QCocoaScreen logging
Change-Id: I91f89ff336b3f48aea91e50860264bd8359805cb
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-10-27 20:18:59 +01:00
Tor Arne Vestbø
5982451ac6 macOS: Class initialize QCocoaScreen members
Change-Id: I163858400da28668b8a85241e9e6b1d989227a3e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-10-27 20:18:56 +01:00
Tor Arne Vestbø
360a2e79c8 macOS: Don't leak CFUUIDRefs when resolving NSScreen for platform screen
Change-Id: I5609071346ef44dc9f16359db451ea9b29dd2b0d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-10-27 20:18:52 +01:00
Tor Arne Vestbø
22c3fd0508 macOS: Remove assert that primary display always matches CGMainDisplayID
Fixes: QTBUG-78707
Change-Id: Ia517f543728c76dcf19558e9e68ed97db7cfaaa4
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-10-27 20:00:02 +02:00
Yulong Bai
a21d4395f4 Drag'n'Drop: fix attached Drag object deleted when DnD is progressing
The attached Drag object's owner, i.e. its parent, is also the dragged
item. So the attached Drag object will also be destroyed as the dragged
item is deleted.

Fixes: QTBUG-65701
Change-Id: I39b0a3180f205c427deed5c70cd1912524f9324e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-10-27 17:40:44 +02:00
Joerg Bornemann
73cb5cb01e Fix prefix for non-Windows cross-builds on Windows
When one specified a prefix "/usr/qt5" on Windows for a non-Windows
target (e.g. QNX) that prefix was translated to "C:/usr/qt5" and
passed on to the Makefiles, for example as
"-Wl,-rpath,C:/usr/qt5/lib".

The reason was that we called $$absolute_path on the user-specified
prefix. However, absolute_path operates according to the rules of the
host operating system.

When cross-building, the prefix is an on-device path. Therefore we
must not attempt to make it absolute to the build directory.

The check whether we're cross-compiling looks a bit arcane, but we
cannot use $$qtConfEvaluate(features.cross_compile) at this stage of
configure. Instead, we use XSPEC (set up by qtConfOutput_prepareSpec)
and $$[QMAKE_SPEC] which is the right host mkspec.

Fixes: QTBUG-79214
Change-Id: Id8664f8512cf1d9e178054a38e72323d7929547d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2019-10-25 18:15:36 +02:00
Edward Welbourne
48603baf94 Update public suffix list to latest version
[ChangeLog][Third-Party Code] Updated DNS public suffix list

Task-number: QTBUG-79418
Change-Id: I02dbe2b1f5b5f3e4a1ed4fde60ee71f5b0a50cb5
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-10-25 18:06:23 +02:00
Edward Welbourne
265b25a5c3 Specify year in month name lookups for QCalendarWidget
The compiler didn't complain at a QLocale::FormatType values being
passed for the int year parameters of the month-name functions, which
all have a default for their final QLocale::FormatType parameters. So
we didn't notice that the year parameter was missing until the bug was
reported.

Removed some code duplication by giving QCalendarModel a monthName()
method. Reworked QCalendarMonthValidator::text() to avoid repeated
calendar calculations (and use fewer braces).

This commit amends commit 2dee006216

Fixes: QTBUG-79495
Change-Id: Iad48c3b648a0139ab43511e6fb4e6a8f63a0495f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-10-25 18:06:06 +02:00
Cristián Maureira-Fredes
968cc365d2 uic: Add language::eol in more cases for python code
Change-Id: I0ab4b37399d3fba6d27cf90cab22676a3c599e5a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-10-25 15:53:13 +02:00
Cristian Adam
52c799ed44 Android: Add multi-abi support for CMake
The patch adds ANDROID_BUILD_ABI_<abi> CMake options, which when enabled
will determine CMake to build the current project with the enabled ABI
settings.

When building with CMake and the official Android CMake toolchain
one needs to specify the Qt base directory as an argument to
CMAKE_FIND_ROOT_PATH, which contains the Android NDK sysroot
set by the toolchain.

CMake will consider directories that contain this base path as
valid directories to search packages. In the developer build case we
have to append "lib/cmake" because the Qt base directory passed as
CMAKE_FIND_ROOT_PATH will be the same directory as the developer
build base, and will not be considered.

Change-Id: I180502032c8ea1105bde2456252b367497f511d6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2019-10-25 14:54:28 +02:00
Eirik Aavitsland
f3dbe98dca Update bundled libjpeg-turbo to version 2.0.3
[ChangeLog][Third-Party Code] libjpeg-turbo was updated to version 2.0.3

Task-number: QTBUG-79420
Change-Id: I9f9b8b3a913fd5843759c0610f43b22c5bee67dc
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-10-25 14:33:11 +02:00
Filippo Cucchetto
2fac76e719 Windows QPA: add support for MouseDoubleClickDistance
Query the double click distance using the windows GetSystemMetric.
See https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getsystemmetrics

Change-Id: I6198a38ab1a6216286897f8bdb305f334b7b148e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-25 14:12:44 +02:00
Jüri Valdmann
698a95dc8a QFontDatabase: Delete redundant semicolons
There are too many semicolons. Delete some.

Fixes two warnings from Clang 9.0.1.

Change-Id: I363a6a2de9c075c03da62c58ad46828c04a95440
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-10-25 13:05:22 +02:00
Jüri Valdmann
bafb8220b4 Disable Clang warning for 'using namespace' in qtextstream.h
This header file intentionally puts a 'using namespace' into the global
namespace, the artful cleverness of which Clang doesn't properly appreciate.
Teach Clang a lesson by disabling the warning.

Change-Id: I9754ac5fc9d4c53654854082e1145d8b5fef186d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-10-25 13:05:07 +02:00
Edward Welbourne
43f64b4dc8 Update CLDR to v36
Released on October 4th.
Adds Windows names for two time zones, Qyzylorda and Volgograd.
Added languages Chickasaw (cic), Muscogee (mus) and Silesian (szl).

Norwegian number formatting has flipped back to using colon rather
than dot as time separator; it's flipped back and forth over the last
several CLDR releases.  The dot form is present as a variant, the
colon form was long given as the normal pattern, then went away; but
now it's back as a contributed draft and that's what we pick up.

The MS-Win time-zone ID script was iterating a dict, causing random
reshuffling when new entries are added. Fixed that by doing the
critical iteration in sorted order.

Omitted locales ccp_BD and ccp_IN due to QTBUG-69324.

Task-number: QTBUG-79418
Change-Id: I43869ee1810ecc1fe876523947ddcbcddf4e550a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-10-25 11:44:48 +02:00
Edward Welbourne
6852ba815d Correct some references to corelib/tools/ to say corelib/text/
The Unicode data tables moved with QString and friends.
So did the locale data generated from CLDR.

This amends commit a9aa206b7b.

Change-Id: If12f0420b559dcb78993adc00e9f39751bca684a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-10-25 11:44:27 +02:00
Edward Welbourne
ef9c498215 Tidy up data-stream test
While I was looking into a bug related to problems building the test
without GUI, I noticed a lot of spurious #include lines so tidied up a
bit.  Split some long lines, while I was about it.

Change-Id: Id87eb6f612c6b174f8240dfe9c00e0929244fb6c
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-10-25 11:44:13 +02:00
Edward Welbourne
425df43d7f Update double-conversion library to 3.1.5
Part of the 5.14.0 third-party component update.

[ChangeLog][Third-Party Code] Updated double-conversion code to
upstream version 3.1.5.

Task-number: QTBUG-79418
Change-Id: I70c3890fcfa0606c462cc0fe702d0f62fd9c7279
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-10-25 11:43:27 +02:00
Edward Welbourne
a9ac6c89be Compile-fixes in the generator for qurltld_p.h
This is a follow-up to c0ab2ad98f.

Change-Id: Ic05d80fa0561f7609703407cc58a0caccbcb1061
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-10-25 11:43:04 +02:00
Edward Welbourne
59ca056a79 Exclude tests that need GUI when GUI isn't available
Thanks to Dmitriy Purgin for pointing out the serialization one.

Task-number: QTBUG-79353
Change-Id: Ia3d750b17ddd8fbb7a83a55df7e4546ca78c358b
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-10-25 11:42:09 +02:00
Edward Welbourne
fd3db1dc3a Don't try to define QT_NO_CAST_TO_ASCII when the test undefines it
The qmake config for tst_QString tried to impose QT_NO_CAST_TO_ASCII
on it, but the source file explicitly #undef-s this symbol and its
friends. Leave the define commented out in the .pro so that a comment
can explain why it's no good.

Change-Id: I7620f4e104f0cdab05fdc246b903c40026e63d76
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-10-25 11:41:44 +02:00
Edward Welbourne
946c701883 Move a test for feature ICU from .pro to .cpp
Test QT_CONFIG(icu) in the code instead of testing qtConfig(icu) in
the profile and setting an extra define just to shadow what's already
defined. Also remove the matching define from qcollator.pro, whose
test code didn't use it.

Noticed while reviewing the conversions to CMake.

Change-Id: I19d3b1026b2a8f50ec424c450614e721500fd38a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2019-10-25 11:41:30 +02:00
Johan Klokkhammer Helsing
c9b3091be5 tst_qgraphicspixmaptiem: Fix undefined behavior in contains
See the comment in the test for details.

Change-Id: Ie3d356e476ba0419d304bccd396fc18a831a30cd
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-10-25 07:20:54 +00:00
Andy Shaw
a7a24784ee Revert "iOS: Account for when the older SDK is used when building"
This reverts commit 631efee293.

Reason for revert: This causes a problem when running on iOS 11 devices.

Change-Id: If5194989b8d7a9f4cf2d72e770fdaad754d7e236
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2019-10-25 07:16:48 +00:00
Christian Romberg
6acab25f97 Remove GCC-style PCH directives from android-clang mkspec
As described in QTBUG-72404, the android-clang mkspec has the gcc pch
style hardcoded for no reason. This change removes the respective lines.

[ChangeLog][qmake][Android] Remove gcc-style PCH directives from the
android-clang mkspec.

Fixes: QTBUG-72404
Change-Id: Iad42651e25ecce08eda7aa5fa8bbf531c9497896
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2019-10-25 07:04:57 +00:00
Christian Romberg
059172c633 Fix precompiled headers for Clang
Precompiled headers were put in a directory which had exactly the same
name as the binary to be generated. This resulted in a failure with any
mkspec that used clang_pch_style. The g++-mkspec avoid this problem by
extending the directory name. This change adopts this technique for
clang mkspecs.

[ChangeLog][qmake] Fixed precompiled headers for the Clang compiler.

Fixes: QTBUG-72404
Change-Id: I471462e2bcb1e33f19d277c21acde0c04b1ffcd6
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2019-10-25 07:04:50 +00:00
BogDan Vatra
b5b9eb68c4 Fix typo
Change-Id: I9a429805414fb50aa059677beb5f8f8a48b72d9b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-10-25 07:03:37 +03:00
BogDan Vatra
1ce71a6a11 Fix bundled_libs section from libs.xml
Fixes: QTBUG-79376
Change-Id: If7681365110341379913ae46a96a2f2296197b8f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-10-25 07:01:32 +03:00
Samuel Gaist
c8aadc79fc QSet: Document to/from QVector transformation techniques
Change-Id: I2a2ff6332bd6e8ed3d4ba7b4765da0a94a06f133
Fixes: QTBUG-71067
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2019-10-24 23:10:21 +02:00
Shawn Rutledge
cffb88928c Update 3rdparty/md4c to post-0.3.4
0.3.4 is the newest tagged release. This updates to upstream
0354e1ab5a453e9913dcd5f87c2cfe9a2510dfda which has a change that
affects behavior of the ".\n" case in QTBUG-78870 (it will be
seen as a paragraph rather than a list item).

Task-number: QTBUG-78870
Change-Id: Ib01f9c1d3f71a39782608da071c2f42512845382
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-10-24 20:19:15 +00:00
Shawn Rutledge
d377d1f3a9 Enforce QTextDocument::MarkdownFeature compatibility at compile time
We use md4c for parsing markdown.  It provides flags to control the
feature set that will be supported when parsing particular documents.
QTextMarkdownImporter::Feature is a fine-grained set of flags that
exactly match the md4c feature flags that we support in Qt so far.
QTextMarkdownImporter is a private exported class (new in 5.14).
We don't expect the corresponding flags in md4c to change in
incompatible ways in the future: the md4c authors have as much respect
for avoiding compatibility issues as we do, and likely will only add
features, not remove them.

We now enforce QTextMarkdownImporter::Features compatibility with
QTextDocument::MarkdownFeatures by setting them directly.  We check
QTextMarkdownImporter::Features compatibility with md4c's #define'd
feature flags using static asserts, so that any hypothetical
incompatibility would be detected at compile time.
The enum conversion from QTextDocument::MarkdownFeatures to
QTextMarkdownImporter::Features is moved to a new QTextMarkdownImporter
constructor; thus the conversions from QTextDocument::MarkdownFeatures
to QTextMarkdownImporter::Features, and then to unsigned (in
QTextMarkdownImporter::import()) are adjacent in the same private class
implementation.  If incompatibility ever occurred, we would need to
replace one or both of those with another suitable conversion function.

Change-Id: I0bf8a21eb7559df1d38406b948ef657f9060c67b
Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
2019-10-24 20:58:44 +02:00
Christian Ehrlicher
5edf34848a QTableView: properly deselect row when column 0 is hidden/not visible
When the first column is hidden or not visible in the current viewport,
it is not possible to deselect the current row.
Fix it by passing the correct column to
QItemSelectionModel::selectedRows() when testing if the current index is
selected.

Fixes: QTBUG-79092
Change-Id: I9d8082d2b29ad2f799156aee910c6ff6e3217771
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-10-24 19:41:14 +02:00
Alexander Volkov
fcbf15c97b QKeySequence: Add missing names for multimedia keys
Task-number: QTBUG-40030
Change-Id: Ib34bcbf42d6dd1206209c2d76444fd8c777278fe
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-10-24 15:58:00 +03:00
Antti Kokko
c37af0ba2d Add changes file for Qt 5.13.2
Change-Id: Iaf3f96e6c0dc5786fc3dc8667952813e5aa366b2
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-10-24 13:59:27 +02:00
Ulf Hermann
9ab043b688 QFileSystemEngine: Consistently check for invalid file names
stat() and friends expect a null-terminated C string. There is no way to
generate anything useful from a string that has null bytes in the
middle. It's important to catch this early, as otherwise, for example, a
QDir::exists() on such a path can return true, as the path is silently
truncated.

Extend the checks for empty file names to windows and add checks for null
bytes.

Change-Id: Ie9794c3a7c4fd57f9a66bdbbab8b45a08b6f9170
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-10-24 13:37:22 +02:00
Tor Arne Vestbø
f2edc6cb3a macOS: Don't set NSOpenGLPFANoRecovery for layer-backed views
The Apple software renderer is perfectly capable of being used when
compositing CA layers.

Change-Id: I3b78ff61a79869ecdb7bd431388041f2c124472e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-10-24 13:07:10 +02:00
Ville Voutilainen
9367d966e6 Fix a -Wclass-memaccess problem in qjson
qtbase/src/corelib/serialization/qjson_p.h:230:38: error: ‘void* memcpy(void*, const void*, size_t)’ copying an object of type ‘QJsonPrivate::qle_ushort’ {aka ‘class QSpecialInteger<QLittleEndianStorageType<short unsigned int> >’} with ‘private’ member ‘QSpecialInteger<QLittleEndianStorageType<short unsigned int> >::val’ from an array of ‘const class QChar’; use assignment or copy-initialization instead [-Werror=class-memaccess]
  230 |           str.length()*sizeof(ushort));
      |                                      ^

Change-Id: Ie58e7fe4bae3003227364012ad56ab23bd560d8c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-24 13:58:50 +03:00
Tor Arne Vestbø
312793f28e macOS: Respect Qt::AA_UseSoftwareOpenGL
Change-Id: Ia83e8e9e571e4f46d2a8d810c376015552755457
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-10-24 12:33:51 +02:00
Tor Arne Vestbø
f39230fcac macOS: Skip NSOpenGLContext flush if window exposed size is out of sync
Some clients such as QOpenGLWidget will end up drawing and flushing
during the resize event, which for GL will result in an immediate update
on the screen. The problem is that the underlying Core Animation layer,
and the window's frame, has not been visually updated yet to the new
size, so we end up drawing "ahead" of what the window server is showing
the user.

Ideally we'd be able to present the GL drawing in a transaction, in sync
with the drawing of the window frame, but this API is only available for
CAMetalLayer and CAEAGLLayer.

As a workaround we detect when the exposed size is out of sync with the
window geometry, and skip the flush until the exposed size has caught
up. We know this will happen eventually as AppKit will always ask us
to display after a resize.

Change-Id: I1739ac8878b3fc6820a55dd017ddd170fd5f55d6
Fixes: QTBUG-79139
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-10-24 12:33:40 +02:00
Tor Arne Vestbø
7c9ffe3e46 rhi: Use Q_GLOBAL_STATIC for QRhiGles2 GL program cache
Defers initialization until actually needed.

Change-Id: Idb09dbad0dfa602949d381ee61565d9050e77e7c
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-24 12:18:30 +02:00
Tor Arne Vestbø
444e947aad macOS: Improve handling of wantsBestResolutionOpenGLSurface
We were disabling wantsBestResolutionOpenGLSurface whenever we detected
the Apple software renderer, but this isn't needed when layer-backed,
and did in fact result in the exact same visual result as the bug the
code was working around -- only rendering to a quarter of the viewport.

We now apply the workaround only when software rendering is combined
with surface-backed views.

The logic has also been improved to not rely on string comparison to
look for the software renderer, but instead uses the renderer ID that
the context provides.

Since tweaking the wantsBestResolutionOpenGLSurface is only relevant
when using a window for GL rendering the logic has been moved into
QCocoaGLContext.

Change-Id: I021aaefbb7a9782bc8ee3c9703da246510326d50
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-10-24 12:14:33 +02:00