Commit Graph

37 Commits

Author SHA1 Message Date
Dominik Holland df8e4cdbcd Make sure to setup viewport and scissors also for RenderNodes
Pick-to: 6.8 6.9 6.10
Change-Id: Ie3da3ba0aab73ad61fa32593bcdd19ffcc714a02
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2025-08-18 09:47:16 +02:00
Mitch Curtis 79d4708c10 Use SKIP_IF_NO_WINDOW_GRAB in more places
Amends f7dffe0ae8.

Pick-to: 6.5 6.8
Change-Id: Ic1cc371820180b19d0b55380dbca0040412881ec
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2024-12-05 10:21:55 +08:00
Lucie Gérard 9c5fc88388 Correct license for test files
According to QUIP-18 [1], all test files should be
LicenseRef-Qt-Commercial OR GPL-3.0-only

[1]: https://contribute.qt-project.org/quips/18

Pick-to: 6.7
Task-number: QTBUG-121787
Change-Id: I26d72e8de04d4c7c57b3b7838af5d033265de5ba
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2024-02-27 10:32:21 +01:00
Laszlo Agocs ace43e1db1 Adapt to the RHI API concept
Besides following the header naming changes, make the obvious API
changes that are based on data that is already there but was hidden
previously due to not wanting anything QRhi to shine through in the
public API.

This kind of hiding is no longer needed, even if qrhi.h and similar
still cannot be included from a public header. Forward declarations
are now perfectly fine however.

Task-number: QTBUG-113331
Change-Id: I9a114082cf9218edc487df50956f5793d6b8bdb4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-05-22 12:08:08 +02:00
Laszlo Agocs f9280d48fc Renew tst_rendernode
For one, the Qt 5 autotest remained entirely disabled (with individual
cases all skipped) in Qt 6. Two, most of it is meaningless in Qt 6,
the state changes and the associated flags which are mostly ignored by
the renderer due to the QRhi-based architecture.

Replace the whole test. Start small, and have a test case that renders
using QRhi while exercising the modern QSGRenderNode features, such as
taking the projectionMatrix() into account and specifying
DepthAwareRendering, accessing the QRhiRenderTarget/QRhiCommandBuffer,
etc. This ensures that the basic functionality is not completely broken,
which is important for Qt Quick 3D for example.

For now have just one additional test, a very basic OpenGL one, to make
sure there is an OpenGL context current.

Fixes: QTBUG-105468
Change-Id: I05f4651e2d6b4b0760929aecdd32841ca69fa55c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2022-08-09 20:25:57 +02:00
Lucie Gérard 0dc4fd240a Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
Files that have to be modified by hand are modified.
License files are organized under LICENSES directory.

Pick-to: 6.4
Task-number: QTBUG-67283
Change-Id: I63563bbeb6f60f89d2c99660400dca7fab78a294
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-06-11 08:05:15 +02:00
Mitch Curtis e310dadef7 Consolidate test helpers into private libraries
Previously each test would include and build sources from the shared
folder. Now we make those sources a library, build it once, then have
each test link to it instead.

We also take the opportunity to move some helpers that qtquickcontrols2
had added into the quicktestutils library where it makes sense, and
for the helpers that don't make sense to be there, move them into
quickcontrolstestutils.

We add the libraries to src/ so that they are internal modules built as
part of Qt, rather than tests. That way we can use them in a standalone
test outside of qtdeclarative.

Task-number: QTBUG-95621
Pick-to: 6.2
Change-Id: I0a2ab3976fdbff2e4414df7bdc0808f16453b80a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-09-13 21:17:04 +02:00
Laszlo Agocs b5b0a39a2a Add missing Quick autotests to CMakeLists
Restore autotests that went missing in the tests/auto/quick
project file during the qmake->CMake conversion.

Adjust the conditions as relevant for Qt 6, e.g. the qmake
project still had some now-unnecessary OpenGL and Widgets
conditions.

The rendernode test has not been fully migrated to Qt 6 and it's
pretty much just QSKIPs for now. This is to be remedied at a later
point. The drawingmodes test gets one test disabled for macOS due
to unexpected results in the Apple M1 CI configuration (which now
has Metal, unlike other the Intel macOS VMs), to be checked later.

Do some necessary source code changes as well. Some of these tests
did not even compile since they were not exercised in the CI for some
time now.

Change-Id: Ibcdd7d61f72165ce1c11847d02635340be0c44b1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2021-06-08 20:59:26 +02:00
Volker Hilsheimer 4a77e2593f Mark overrides in tests, fix compiler warnings
Change-Id: If753558d911e50a73e351a93eed2e4df3e6592c7
Reviewed-by: David Skoland <david.skoland@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-04-01 10:14:16 +02:00
Qt Forward Merge Bot 1eef06e64f Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I6f320ea43b5837444226228c118e57c4bda8702a
2020-03-20 01:00:59 +01:00
Allan Sandfeld Jensen 056016a1d8 Fix copy-pasted typo minimimal -> minimal
Change-Id: I4afef3fdbb9e3c3ec20ba5d00307992131b9ba3e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-03-18 22:03:50 +01:00
Johan Klokkhammer Helsing 872dc18e65 Quick: Don't qualify OpenGL includes (part two)
406f15ce0e only removed the "QtGui" prefix from some includes, but we are
trying to move (almost) everything OpenGL related from QtGui.

This removes prefixes for additional QOpenGL includes (QOpenGLShaderProgram,
versioned opengl functions etc.).

Task-number: QTBUG-74409
Change-Id: I91e1feac0676859f11de9b75301a0a4e81db50d9
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-02-18 09:51:27 +01:00
Simon Hausmann 880a143eb5 Merge remote-tracking branch 'origin/dev' into wip/qt6
Change-Id: I4476733af61fcf3a2af1d121a4585c3fae1c240e
2019-07-12 20:36:48 +02:00
Friedemann Kleint 83f8d886ce Fix some compiler warnings in tests
- Signedness of integer comparison
- Unused parameters and variables
- Ignored return values of QTest::qWaitForWindowExposed() (nodiscard)
- float to int conversions

Change-Id: Ibece620d3c980a5af3b7717486c841d8072ed8af
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-07-12 16:00:51 +02:00
Alexandru Croitor c0987d3923 Fix Qt6 builds after dev -> wip/qt6 merge
Change-Id: I56b9d3abdbc6663a2d514f12aa20f2f574042bc1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-07-09 21:27:24 +02:00
Laszlo Agocs 341ab77080 Add the graphics api independent scenegraph port
Opt in via environment variables:
QSG_RHI=1 -> enable using QRhi instead of GL
QSG_RHI_BACKEND -> set to vulkan, metal, d3d11, gl to override the default
(the default is d3d11 on Windows, metal on Mac, gl elsewhere)

Or force a given rhi backend via the existing
QQuickWindow::setSceneGraphBackend().

Otherwise the default behavior is the same as before, the rhi code path
is never active by default.

-no-opengl builds are supported in the sense that they work and default
to the software backend. However, the rhi code path cannot currently be
used in such builds, even though QRhi from qtbase is fully functional
with Vulkan, D3D, or Metal even when qtbase was configured with
-no-opengl. This cannot be utilized by Quick atm due to OpenGL usage
being all over the place in the sources corresponding to the default
backend, and those host the rhi code path as well. This will be cleaned up
hopefully in Qt 6, with the removal all direct OpenGL usage.

Other env.vars.:
QSG_RHI_DEBUG_LAYER=1 -> enable D3D debug or Vulkan validation layer
(assuming the system is set up for this)
QSG_RHI_SHADEREFFECT_DEBUG=1 -> print stuff from ShaderEffect
QSG_SAMPLES=1,2,4,... -> MSAA sample count (but QSurfaceFormat works too)
QT_D3D_ADAPTER_INDEX=0,1,... -> D3D adapter index
QT_VK_PHYSICAL_DEVICE_INDEX=0,1,... -> Vulkan physical device index
QSG_RHI_UINT32_INDEX=1 -> always use uint index data (both
merged/unmerged, convert when needed - with some rhi backends this is
implicit)
QSG_RENDER_LOOP -> to override the render loop as usual. The default
with RHI is threaded for Metal, threaded for Vulkan on Windows, basic
for Vulkan on Linux and Android (to be checked later), while the existing
rules apply for OpenGL.

Not supported when running with QRhi:
  - particles
  - compressed atlases (though this is transparent to the apps)
  - QSGRenderNode
  - QQuickRenderControl
  - QQuickFramebufferObject
  - certain QQuickWindow functionality that depends directly on OpenGL
  - anisotropic filtering for textures
  - native text may lack some gamma correction
  - QSGEngine applicability unclear
  - some QML profiler logs may be incorrect or irrelevant

Change-Id: I7822e99ad79e342e4166275da6e9e66498d76521
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-07-04 10:44:26 +02:00
Shawn Rutledge 06e962f263 init variables where they are declared when possible (clang-tidy)
clang-tidy -p compile_commands.json $file -checks='-*,modernize-use-default-member-init,readability-redundant-member-init'
 -config='{CheckOptions: [{key: modernize-use-default-member-init.UseAssignment, value: "1"}]}' -header-filter='qtdeclarative' -fix

Change-Id: I705f3235ff129ba68b0d8dad54a083e29fcead5f
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
2018-02-26 13:08:30 +00:00
Sami Nurmenniemi d8d3259b23 Enable tests for boot2qt
Some tests needed fixing
- Disabled tests too heavy for qemu
- Skipped tests requiring OpenGL without support from the platform
- Skipped tests requiring functionality on broken offscreen platform
- Skipped tests that take too long on qemu + software renderer
- Blacklisted tests for created bugs QTBUG-63049, QTBUG-63053
  QTBUG-63055 and QTBUG-63057

Task-number: QTBUG-60268
Change-Id: I0346b0e436cf286d7d9cbc140acf324a4087cfb9
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-09-21 06:56:11 +00:00
Liang Qi f5da1a9261 Merge remote-tracking branch 'origin/5.7' into 5.8
Conflicts:
	src/quick/items/qquickitemsmodule.cpp
	tests/auto/quick/rendernode/tst_rendernode.cpp

Change-Id: I90582df69feb95a4e4aafb0b9793c23714654f19
2016-10-20 08:28:16 +02:00
Mitch Curtis dd313c4c5e Fix tst_rendernode::renderOrder() on high DPI displays
When QT_SCALE_FACTOR is 2, fb.width() is 400 instead of 200, for
example.

Change-Id: Iec02d7cfd49d29fceda6645377b75e4607cceb6f
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-10-17 20:42:13 +00:00
Frederik Gladhorn 123481f94e Fix tst_rendernode to work with hidpi
Change-Id: Id2a7f20933533f69fa43eefc2338205b82a27ccd
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2016-07-04 14:34:12 +00:00
Laszlo Agocs 9c19298510 Fix up rendernode autotest
Test the new RenderTargetState as well.

Make releaseResources() optional. Code focusing on OpenGL only may not
want to care about providing an implementation for it. It is also more
compatible with the old private API this way.

Change-Id: I0dcec1d48708e71d778a8e5fea1b64d710bee67f
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2016-04-20 13:22:29 +00:00
Jani Heikkinen 38ec3bd755 Updated license headers
From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some
exceptions, see
http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/

Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one
(in those files which will be under GPL 3 with exceptions)

Change-Id: I04760a0801837cfc516d1c7c02d4f503f6bb70b6
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-01-20 11:46:25 +00:00
Jani Heikkinen c5796292ad Update copyright headers
Qt copyrights are now in The Qt Company, so we could update the source
code headers accordingly. In the same go we should also fix the links to
point to qt.io.

Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9
Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
2015-02-12 10:28:11 +00:00
Jani Heikkinen e7ceacda70 Update license headers and add new licenses
- Renamed LICENSE.LGPL to LICENSE.LGPLv21
- Added LICENSE.LGPLv3 & LICENSE.GPLv2
- Removed LICENSE.GPL

Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
2014-08-25 11:28:46 +02:00
Laszlo Agocs 08f9b552c3 Avoid direct GL calls in Qt Quick examples and tests
Change-Id: I204a5513708aeff5cae00d06d4f0c27c20a13ace
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-07-01 14:20:49 +02:00
Gunnar Sletta ea164757cd Use correct matrix for render nodes.
Change-Id: I8c137383fa32a64ba64ffb4ed48aa123d0ebf000
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-05-07 13:53:57 +02:00
Fabian Bumberger b5ceb6edf1 Fix RenderNode autotest on BlackBerry
On BlackBerry the first window that is created is always shown as fullscreen.
This is a platform restriction and possibly applies to other platforms as well.
The autotest however expects the window to be of a specific size.
As workaround a "container" window is created first in which the QQuickView is placed.

Change-Id: Ib9023cfcb9148c6cafb21872c2821ebcb8fd664f
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
2014-01-15 01:10:19 +01:00
Gunnar Sletta 8d6500560e Fix rendernode bug and enable rendernode test.
The bug in the renderer was that the viewport was set before
we called the render node, leaving us with the viewport
set by the render node as opposed to the viewport of the
renderer.

The render node API is a crude and intrusive hack which was added for
webkit back in the day. With the introduction of webengine it becomes
less relevant, but it should still work.

Change-Id: I66a1e3047e018ad6c0bb28044851e9fc65da59cc
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
2013-10-26 23:53:38 +02:00
Friedemann Kleint a166f7974b Stabilize tst_rendernode.
Center windows on screen, add QSKIP for screen depth, add error message
to color comparison.

Change-Id: I03d600a4810f27654e0b971b19631ba51c9f6874
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-08-30 15:52:44 +02:00
Rafael Roquetto 56324d40c7 Fix tst_rendernode for fullscreen platforms
Change-Id: Ib82aef04b7748ecdf148c3d9ec60ad15b3dfd7cb
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-07-25 18:23:12 +02:00
Sergio Ahumada 83deab8d1b Update copyright year in Digia's license headers
Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76
Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2013-01-10 19:52:37 +01:00
Iikka Eklund 46010aa7a2 Change copyrights from Nokia to Digia
Change copyrights and license headers from Nokia to Digia

Change-Id: Ie7f5d49ed8235d7a7845ab68f99ad1c220e64d5c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-09-23 08:22:24 +02:00
Friedemann Kleint c20463631d QtQuick: Remove usages of qWaitForWindowShown(QWindow *).
Change-Id: I722e20b2fb8d8c6c19c6f3f2cb16910d7433e9a4
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-07-24 16:53:08 +02:00
Alan Alpert feb996e3ab QQuickCanvas renames
QQuickCanvas is now called QQuickWindow
QQuickCanvas::rootItem is now QQuickWindow::contentItem
QQuickItem::canvas is now QQuickItem::window
QQuickItem::ItemChangeData::canvas is also renamed window
QQuickCanvas::grabFrameBuffer is now QQuickWindow::grabWindow
The functions related to the color property have dropped the clear from
their names.

The first three changes have interim compatibility measures in place to
ease the transition.

Change-Id: Id34e29546a22a74a7ae2ad90ee3a8def6fc541d2
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-07-17 07:26:15 +02:00
Miikka Heikkinen 21e228afa7 Windows: Fix file URL issues in declarative autotests
Fixed by using testFileUrl() shared utility function where appropriate
instead of testFile() or various other ways file URLs were being
incorrectly used.

Task-number: QTBUG-24779
Change-Id: I48cbd297d419238f42ea45132344b7e5a487b6f1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-15 11:25:36 +01:00
Matthew Vogt b855240b78 Rename QDeclarative symbols to QQuick and QQml
Symbols beginning with QDeclarative are already exported
by the quick1 module.

Users can apply the bin/rename-qtdeclarative-symbols.sh
script to modify client code using the previous names of the
renamed symbols.

Task-number: QTBUG-23737
Change-Id: Ifaa482663767634931e8711a8e9bf6e404859e66
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-02-24 04:51:31 +01:00