Commit Graph

40353 Commits

Author SHA1 Message Date
Sona Kurazyan
b0cd007335 Remove usages of QSysInfo's deprecated APIs
- Replaced QOperatingSystemVersion::WindowsVersion,
  QSysInfo::windowsVersion(), QSysInfo::macVersion(),
  QSysInfo::MacintoshVersion with QOperatingSystemVersion::current().

- Added QOperatingSystemVersion::WindowsVista for convenience, as it
  is used in lots of places.

Change-Id: If9c4ac496005b2e70b5c70be160747afa74b98c1
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-07-05 09:26:17 +00:00
Sona Kurazyan
9b3e8b32f2 Remove usages of deprecated APIs of corelib
- Replaced the usages of deprecated APIs of corelib by corresponding
  alternatives in the library code and documentation.

- Modified the tests to make them build when deprecated APIs disabled:
    * Made the the parts of the tests testing the deprecated APIs to
      be compiled conditionally, only when the corresponding methods are
      enabled.
    * If the test-case tests only the deprecated API, but not the
      corresponding replacement, added tests for the replacement.

Task-number: QTBUG-76491
Task-number: QTBUG-76539
Task-number: QTBUG-76541
Change-Id: I62ed4a5b530a965ec3f6502c6480808f938921aa
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-05 11:25:46 +02:00
Lars Knoll
6061e6820b Initialize variables to make coverity happy
Change-Id: Id574a114cbed04927ae380c6d97027cf4b351032
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-07-05 09:33:50 +02:00
Jan Arve Sæther
bcd4b14026 Fix qFindTestData() to work with relative resource paths
If the resource path 'base' was relative it would enter condition 3) in
qFindTestData() and it would actually find the nonsensical "://data" as a
viable candidate.  We don't want to enter that case, but rather enter the
subsequent ('Try resources') case

Change-Id: I1928ba02c941e23fee4fec9052a1981e46fa59b7
Task-number: QTBUG-73512
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-07-05 09:11:35 +02:00
Jan Arve Sæther
c4932f93d5 Do not access invalid QAccessibleInterface
Noticed this when running Qt Creator against dev

Change-Id: Ie75b2e0f2a77033ce0455d7ee3304193aa6e511c
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
2019-07-05 09:11:31 +02:00
Tasuku Suzuki
be1e682572 Fix build without feature.xmlstreamreader
This commit introduces a new feature called vkgen for the tool which
depends on xmlstreamreader.

Note that when features.vkgen is disabled, vulkan.pri will generate
dummy qvulkanfunctions.h and qvulkanfunctions_p.h because buildsystem
needs them.

Task-number: QTBUG-76159
Change-Id: I03d526a0fd76a2d8b531940f37538cead109d9d3
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-07-05 16:11:28 +09:00
Tasuku Suzuki
7b17113e49 Fix build without features.inotify
-no-feature-inotify was ignored on Linux

Change-Id: I65bab5b31740f10eacea6735119702a79df5c263
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-05 04:47:35 +09:00
Ulf Hermann
ff561baabd Testlib: Reset the global benchmark data only if it matches
You can create multiple instances of QBenchmarkGlobalData as the ctor
is public.

The qmltest plugin does create a static one, but only conditionally
assigns it to the singleton pointer. On shutdown the plugin is removed
and the QBenchmarkGlobalData::current should only be reset by the dtor
if it's actually pointing to the same object.

Change-Id: I616c1ccf6f7a00abf1de342094da88481510bc7b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-07-04 15:39:09 +02:00
Giuseppe D'Angelo
656117100b QSet docs: don't use std::find for lookups
That code would normally call for QSet::find instead
(Uniform Container Find cannot come soon enough).

Since the code is showcasing a STL algorithm usage,
port it to std::find_if to showcase a real use case.

As a drive-by: fix the usage of endl with std::cout.
(Ok, it's just a variable called "cout", and I'd argue
that in example code "cout" is not the name of a
QTextStream).

Change-Id: I8686178b33c31552eb4d909a4089453d60994b79
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-07-04 09:22:19 +02:00
Friedemann Kleint
1bddb4ad7d QApplication::topLevelWidgets(): Avoid allocation of list
Use the QSet QWidgetPrivate::allWidgets directly instead of
calling QApplication::allWidgets(), which allocates a QList.

Change-Id: I16d289030cecefae7811d4b2c94f865f46f700d5
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-07-04 08:23:00 +02:00
Tasuku Suzuki
c50362597a Fix build without features.cursor
Change-Id: Id7617e03f86a4dd7d1ada37c91cf792bca7f1d6d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-04 09:59:52 +09:00
Lars Knoll
1e4a973b7e Use QRegularExpression for filtering in QDirIterator
Reduce our usage of QRegExp in preparation towards deprecating
it. This also brings it in line with QDir that already uses
QRegularExpression for filtering.

Keep the old QRegExp based code around in bootstrapped mode,
since qmake uses this functionality.

Change-Id: I98b9d2875c30e17e406b6711dfe3265ba37624ac
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
2019-07-03 22:15:48 +01:00
Andy Shaw
faf742b05d dumpcpp: Run dumpcpp if the generated files do not exist at qmake time
By running dumpcpp if the files do not exist at qmake time we enable
the dependency finder to find these files and set up the dependencies
as appropriate. Since other changes ensure that dumpcpp will be called
at the right time when building if the typelib changes, we no longer
need to have the generated files dependent on the objects. As a
result, we are able to prevent it from unnecessarily rebuilding
everything if certain files are updated.

Change-Id: I334f48c7a980aa8b893c14cb2a4687d3b2b7a4b9
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-07-03 22:15:44 +01:00
Mikhail Svetkin
f883f8409f qtlite: Fix build with -no-feature-commandlineparser
Change-Id: Ie7b7b119073691c0d3b6358f876298fc86cfe9e9
Reviewed-by: Tasuku Suzuki <tasuku.suzuki@qbc.io>
Reviewed-by: Timo Aarnipuro <timo.aarnipuro@qt.io>
Reviewed-by: Kari Oikarinen <kari.oikarinen@qt.io>
2019-07-03 23:15:40 +02:00
Marc Mutz
f70905448f Add QT_NO_JAVA_STYLE_ITERATORS and mark QtBase free of it
... except for tests, which manually undefine the macro.

Like QT_NO_FOREACH, this is a technical way to keep JSI-free
modules JSI-free going forward.

Change-Id: Icf1342da00a700f42f9e32a253d1cdb94c38dd7e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-07-03 14:48:37 +02:00
Marc Mutz
f99bbfb9ea QFseventsFileSystemWatcherEngine: port some Java-style iterators to ranged-for
Amends b03385f9cf.

Java-style iterators are scheduled to be deprecated.

The general pattern used in the patch is that instead of copying an
input list, then iterating over the copy with some calls to
it.remove() (which leads to quadratic-complexity loops), we simply
copy conditionally (a la remove_copy_if instead of remove_if).

To make clearer what's going on, rename the outgoing list to
'unhandled'.

To avoid having to touch too much of the loops' structure, which
sometimes is quite convoluted, use qScopeGuard to do the append to
'unhandled', unless the original code removed the element.

Change-Id: I808a939b9c816b329ee87620e0a3461fee6e3e40
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-07-03 14:48:33 +02:00
Timur Pocheptsov
33fdd5c833 Fix a warning treated as error - 'importDevice not used'
Change-Id: Id48ff52d6532cf3585648addd498cdddccbcb994
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-07-03 14:48:28 +02:00
Marc Mutz
e1c9276c77 Optimize QSet set operations
Replace the identity check with a check for the underlying QHash
objects being shared and replace backwards iteration, which is really
forwards iteration with wrapping at bucket boundaries, with forward
iteration. QSet cannot contain duplicates, so the order in which the
RHS elements are presented to the algorithms does not matter.

Change-Id: Iad8528e3a9501b14cb85601b221a848aad91480c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-07-03 14:48:24 +02:00
Friedemann Kleint
e40a139abf QtWidgets: Fix wrong screen returned by newly added QWidgetPrivate::associatedScreen()
QWidgetPrivate::windowHandle() should not return nullptr from the
WindowHandleMode::Direct branch in case WindowHandleMode::Closest was
passed.

Ameds eed9a8fbd3.

Task-number: QTBUG-62094
Task-number: QTBUG-73231
Change-Id: Ia55fff15f0a499cef9525e53111ddd55b2e012d0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-07-03 14:48:20 +02:00
Jan Arve Sæther
ee6b19042f Fix 'make check' for android-mingw32
g_options.buildPath did not have native separators. This caused
INSTALL_ROOT to not have native path separators, which again made
'mingw32-make check' fail to deploy the .apk. (The actual failure was that
mkdir failed because it did not accept paths with forward-slashes, so the
install_target rule failed. For the record, the command of that rule had
the following call to mkdir:

mkdir $(INSTALL_ROOT:@msyshack@%=%)\libs\x86

Change-Id: Id792c36986b52a527546d48aa9f7d9587e7a18d9
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
 
 
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2019-07-03 09:25:46 +02:00
Christian Ehrlicher
1e4e006c3f QPainter: mark obsolete RenderHints as deprecated
RenderHint::HighQualityAntialiasing and NonCosmeticDefaultPen are
obsolete since Qt5 but not marked as such. Therefore add
Q_DECL_ENUMERATOR_DEPRECATED_X now so those two enumerations can be
removed with Qt6.

[ChangeLog][QtGui][QPainter] HighQualityAntialiasing and
NonCosmeticDefaultPen are marked as deprecated and don't have an effect
anymore

Change-Id: Ib0c966a078a1d23d492d0255288e2066c50e87b6
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-07-03 06:53:34 +02:00
Friedemann Kleint
e5ab131c18 tst_QShortcut: Remove test widget and other member variables
Remove the mainW, edit widget member variables from the test and use
widgets instantiated on the stack in the tests.

For the data-driven tests, use a static QScopedPointer, which is
reset by a newly introduced TestEnd action.

The book-keeping logic maintaining a list of shortcuts can then be
removed.

The setupShortcut() helpers are simplified and the special case
TestWidget::SendKeyEvent is replaced by a lambda in
keypressConsumption().

Task-number: QTBUG-76493
Change-Id: I15dfa86dfa0666ed8288b7190e37cdb862c261c8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-07-02 22:39:50 +02:00
Friedemann Kleint
9ea53c4a98 QShortcut: Brush up the code, preparing the extraction of a base class to QtGui
- Use member initialization
- Introduce nullptr
- Use auto where applicable
- Use range-based for

Task-number: QTBUG-76493
Change-Id: Ic4dbee2d76a65be1f8a4c25f4ca7e4f032443579
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2019-07-02 22:39:34 +02:00
Friedemann Kleint
3d87ea91af RHI/D3D11: Remove hard dependency on D3DCompiler library
Varying versions of the library may be available depending on build tool
chain or Windows version. Try to dynamically resolve the D3DCompile
function.

Fixes: QTBUG-76845
Change-Id: Ib7eb3b8c454e9c25731eb2ba9ba45e54fe3f1283
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-07-02 22:39:11 +02:00
Marc Mutz
dce7dbecb0 qlalr: replace QLinkedList with std::list
This is in preparation of deprecating QLinkedList.

Most is straight-forward, except where operator+ was used on linked-list
iterators. In one case, replaced this with std::next, in the other, with
prefix increments, since the advancement was always equal to the loop
control variable. Since advancing a linked-list iterator is a linear
operation, this removes a source of quadratic complexity.

Another obstacle was the overloaded op< set, which was in the Qt namespace
while the iterator is from std and the payload, as before, was global.
This breaks ADL, so move these operators to namespace std. This violates
the standard, but the functions are tagged with our distinct types, so it
shouldn't cause any trouble.

Change-Id: Ifec0a927bfdabb002838cdf86fb8d23b32a38ff7
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2019-07-02 22:27:11 +02:00
Joerg Bornemann
13997cccc9 Remove QWindowsDirect2DEventDispatcher
This class was introduced to modify the hook handling of
QWindowsGuiEventDispatcher. As the hook handling code is removed now, we
can remove QWindowsDirect2DEventDispatcher entirely.

Change-Id: I56491a67f163784f43b1025225e536d386cead1d
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-07-02 22:07:02 +02:00
Marc Mutz
5342805920 QCoreWlanEngine: port away from Java-style iterators (and other fixes)
The main goal of this patch was to port away from Java-style
iterators, to make QtBase QT_NO_JAVA_STYLE_ITERATORS-clean. And this
the patch achieves.

But I couldn't resist a few drive-by fixes, too, to wit:

- Use qDeleteAll() instead of while(!isEmpty()) delete takeFirst()

- Use QMap::last() instead of iterating to the end, remembering the
  last-seen value

- Use QMap::contains() instead of QMap::keys().contains()

- Use qExchange() instead of copy+clear

- Make some functions const (requires the mutex member to be marked as
  mutable, which is common for mutex members)

I am almost certain that getSsidFromNetworkName() cannot work correctly.
But this patch does not attempt to change the algorithm.

Change-Id: Ifa04d7837bdc0837036c3a7a73f8c51f4e681f42
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-07-02 12:05:22 +02:00
Joerg Bornemann
d5f65d8814 Remove hook handling code from QEventDispatcherWin32
Since commit 6a7cea64 qt_GetMessageHook is effectively a no-op, and
we can remove the complete hook handling code.

Change-Id: I90383c0c09c2b0f1d715872de5f9519a879d9bae
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-07-02 11:22:17 +02:00
Friedemann Kleint
6df8a30333 tst_QShortcut: Brush up the code, preparing the extraction of a base class to QtGui
- Use nullptr
- Fix static method invocations
- Use QString() instead of QString("")
- Use override
- Use member initialization
- Remove unimplemented code related to status bars
- Use Qt 5 connection syntax
- Fix apparent oversights in ambiguousItems() and
  unicodeCompare(),where the 2nd shortcut was assigned to the wrong button
- Use Q_ENUM for the enumerations which will output the value in
  QCOMPARE and automatically declare them to be a metatype
- Use enums in helper function signature for clarity

Task-number: QTBUG-76493
Change-Id: I0ed6ee7ee8dc2dbb48160a8383e6ed29164c3449
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2019-07-02 11:05:02 +02:00
Sona Kurazyan
8c8eae279d Remove usages of deprecated APIs from QDateTime
- Replaced the usages of:
  * QDateTime::toTime_t() -> QDateTime::toSecsSinceEpoch().
  * QDateTime::fromTime_t() -> QDateTime::fromSecsSinceEpoch().
  * QDate::shortDayName() -> QLocale::system().dayName().
  * QTime by QElapsedTimer, where the deprecated methods of QTime
    were used.

- Modified the tests for the deprecated methods to be enabled only
  when the corresponding methods are enabled: when the deprecated
  APIs are disabled, the tests will be also disabled, and the
  compilation won't be broken.

Task-number: QTBUG-76491
Change-Id: I4d565db2329e580c567aae511696eb1efe120843
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-02 09:49:36 +02:00
Ulf Hermann
c34242c679 Make the default ctor of QVarLengthArray implicit
Otherwise "QVarLengthArray<Foo> x = {};" gives a warning. Also, some
compilers get confused about "QVarLengthArray()" this way.

Task-number: QTBUG-76199
Change-Id: I4296586c0181d3e6e82ca8b7b79aeb9a21645d1f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-07-02 09:39:33 +02:00
Friedemann Kleint
fdef9c8039 uic: Implement form window setting to disable QObject::connectSlotsByName()
Task-number: QTBUG-76375
Change-Id: I16ad147366aa7d52b7a0e17ae240127d8ac34b3c
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2019-07-02 09:15:47 +02:00
Tasuku Suzuki
377ffbd21d Fix build without feature.tabbar
Change-Id: I0891f8f6054382407f5ce2fdb3ead0203d255945
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-07-02 16:15:43 +09:00
Tasuku Suzuki
b727d2f0e1 Fix build without feature.dockwidget and tabwidget
Change-Id: I621664f646475c1b5cfde47b7087c0c9f5ad8e4d
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-07-02 11:16:32 +09:00
Liang Qi
57fccd6f21 Merge "Merge remote-tracking branch 'origin/5.13' into dev" 2019-07-01 19:20:20 +02:00
Mat Sutcliffe
8f4baa3a22 QStringList: utilize QStringMatcher's support for QStringView
This opportunity was missed when adding the QStringView overload of
QStringList::filter() in 2a99f60cfb.

Change-Id: I8d679b92de6cc76c4d59fd54f01a25579ab3488f
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-07-01 16:52:44 +01:00
Edward Welbourne
a4f5f25eb0 Move YearRange to QDateTime from its Private
As planned when adding YearRange: now that it's merged up to dev, move
it to QDateTime, since we can add to the API at 5.14.0.

This follows up on commit 82ad4be4a2.

Change-Id: I81b6c2331121a71e2592514781c02c5756e70c52
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-07-01 17:49:09 +02:00
Edward Welbourne
8bfae093ed Add data for Windows Time-Zone IDs added in the last two years
We've not run util/locale_database/cldr2qtimezone.py for a while, so
CLDR has had time to add several more zones.  Catch up, inserting the
new entries in order.

Change-Id: I8625548b0f7775958230eccbd89b897d7afed9e9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-07-01 17:48:53 +02:00
Edward Welbourne
13242673cf Tidy up in cldr2qtimezone.py and document the need to run it
It wasn't mentioned in cldr2qlocalexml.py's instructions, so I didn't
know to run it.  The data it used in an illustration was out of date.
Two tests could be combined with no loss.

Change-Id: I26e619e6210ea5b1258326fc4bc2b6aee9d6a999
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-07-01 17:48:32 +02:00
Edward Welbourne
bbd64f64b2 cldr2qtimezone.py: report all missing zones, rather than just the first
When scanning the CLDR data, the script raised an exception if it
didn't recognize a zone ID.  Instead, collect up such unrecognized IDs
in a list and report them all at the end, so that whoever runs this
can do them all in one go, rather than doing one, running the script,
doing the next, running the script, ad nauseam.

Change-Id: Ia659f1d1c7e1c1b4ccb87cc23828a0588a5bf958
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-07-01 17:48:16 +02:00
Edward Welbourne
2f19a3053e Use simpler data structures in cldr2qtimezone.py
Use tuples for the fixed data.  The numbering of rows in the data
tables isn't part of any public API, so we can change it freely; it is
thus unnecessary, as we can just enumerate a tuple of the data values
to generate sequential indices on the fly.  (Updates to the data shall
no longer need to renumber in order to insert entries.)

Restore ordering of the data tables, and remove wanton spacing from
inside parens, in the process.

Change-Id: I59956cfb6191fe729300b57070671b7e66bd0379
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-07-01 17:47:51 +02:00
Marc Mutz
7993cada39 QAccessibleWidget: fix UB (invalid cast)
Casting an object to a subclass that is not the dynamic type of the
object constitutes undefined behavior.

Fix by befriending QObject.

Change-Id: Ib70dbef9095df31a6d89449d82a02cef9fccd348
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2019-07-01 17:43:08 +02:00
Joerg Bornemann
2f672b2239 Do not ignore exit codes when installing meta files
Since commit 20e9422e we don't ignore exit codes when installing files
anymore. This patch does the same for meta file installation. We
really should be notified properly if something goes wrong here.

Task-number: QTBUG-18870
Change-Id: Ib6a20293380f400379b10ec767bf38dc74d5beeb
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-07-01 17:39:59 +02:00
Giuseppe D'Angelo
da0f40f9ac QCharRef/QByteRef: schedule for Qt 7 removal
With all of their special behavior deprecated, QCharRef and QByteRef
can simply be removed. Add a comment.

Change-Id: I8bad95424207ae281b5edf348b9ad81c6807dc12
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-07-01 17:37:49 +02:00
Laszlo Agocs
2c289c6c1e rhi: d3d: Fix resource binding mismatch with multiple passes
The resetShaderResources() done when starting a render or compute pass
purges all vertex, index, SRV, and UAV bindings. This will be optimized
at a later point, but until then the command buffer's state should be
updated accordingly, otherwise certain use cases end up with incorrect
rendering results due to not binding vertex/index/shader resources
as appropriate.

This fixes the shadowmap example on d3d.

Change-Id: I4d07929b8664b64bc608c6c8df474b0ee7c2ddbb
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-07-01 17:34:51 +02:00
Laszlo Agocs
058c52fc2a rhi: Improve base vertex/instance support
Have feature flags as appropriate. OpenGL is causing a mess here
but let's support what we can since some of this will become relevant
in more sophisticated mesh drawing cases with 3D in particular.

Change-Id: Idfa7b4642ec87147978e03d78d6233efbd151491
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-07-01 17:34:47 +02:00
Laszlo Agocs
201a22a4d2 rhi: gl: Add support for instanced drawing
...when having a 3.3+ or ES 3.0+ context.

Change-Id: Ie92815263e190912d8f0b7b92ae6da55e062af05
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-07-01 17:34:44 +02:00
Laszlo Agocs
9452c963c8 rhi: Add a test for instancing
Draws 1024 cubes at random x,y positions with varying color with
a single instanced draw call.

Change-Id: I8737503acf23866ad4734b1d88753415a3b93445
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-07-01 17:34:40 +02:00
Laszlo Agocs
03ebad7bfd rhi: gl: Adjust texture and renderbuffer sizes automatically
Enforce the maximum texture size limit both for textures and renderbuffers,
showing warnings and adjusting the size automatically.

On the low end ES 2.0 devices we can easily hit a maximum size of 2048x2048.
For example a Raspberry Pi running in full HD with the Controls 2 Material
style breaks right away as it tries to create slightly wider than 2048 texture
for its ShaderEffect.

Instead of breaking with an obscure framebuffer incomplete warning at best,
show something more informative and adjust the sizes so that something shows
up on the screen still.

(naturally applications not taking the maximum sizes returned from QRhi
into account are technically incorrect and may well end up with incorrect
rendering, but we should still try handling this as gracefully as possible)

Change-Id: Ib75eb893ab4774e1a3c49ed2d14c6bf9be8c807a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-07-01 17:34:37 +02:00
Laszlo Agocs
13a7777bbf rhi: gl: Make fb attachment logic ES 2.0 and WebGL compatible
So that we can now operate on plain ES 2.0 implementations like the
Broadcom stack on the Raspberry Pi (which does not even have packed
depth stencil).

Also add the WebGL-specific combined attach logic to enable WebAssembly.
This has not been tested in practice.

Change-Id: I21219319062f295c1e88e3057c0c2ede724ac664
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-07-01 17:34:33 +02:00