qt6-bb10/tests/auto
Tor Arne Vestbø eb4cb71925 widgets: Use per-surface-format RHI support and compositor
The RHI support and compositor in QPlatformBackingStore were
tied to the surface format of the top level window owning
the backing store.

This meant that inserting an RHI-enabled widget (QRhiWidget,
QOpenGLWidget, QQuickWidget, QWebEngineView) into the widget
hierarchy required recreating the top level window with a
matching surface format that could support the RHI composition.

It also meant that we could not have two RHI enabled widgets
with different surface format requirements (Metal and OpenGL
for example) in the same top level widget hierarchy.

The recreation of the window had various visual side effects,
such as temporarily switching out of full screen state, or the
widget rendering a frame of black, as well as more serious
problems such as not correctly restoring the window geometry.

In addition, if client code had pulled out the winId() of the
window, and did not invalidate these references on window
destruction via QEvent::WinIdChange or QEvent::PlatformSurface,
the client would reference stale window handles. Although
this is a programming error (QWidget::winId() specifically
mentions this requirement), we should avoid recreation if
we can.

We were already supporting flushing the backingstore to
individual native child widgets, but always did so via a
single RHI managed by the platform backingstore. By
expanding QPlatformBackingStore to keep one set of RHI
support and compositor per surface format, we can refine
the logic in QWidget and QWidgetRepaintManager to not
require recreating the top level. Native child widgets
are then flushed independently, including any RHI textures
and raster content that overlaps with the widget.

We still assume that a single RHI support and compositor
can be be used for multiple windows, as long as those
windows have the same surface format. In the future, if
needed, we can refine this to use one set per surface
format e.g.

Fixes: QTBUG-119221
Fixes: QTBUG-121181
Fixes: QTBUG-120096
Task-number: QTBUG-115652
Task-number: QTBUG-108344
Task-number: QTBUG-113557
Task-number: QTBUG-119309
Change-Id: I2635ed3d20c2fb76eab3b8130007dd656a0b93e5
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2024-06-01 00:24:34 +02:00
..
bic/data Add binary compatibility file for 6.7.0 2024-04-17 10:18:37 +00:00
cmake Add copyright and licensing to .cpp and .h files missing them 2024-05-28 09:47:01 +02:00
concurrent Fix truncation warning in generation_helpers 2024-03-18 20:10:34 +01:00
corelib QDirListing: extend unittests to using the class with STL algorithms 2024-05-31 20:30:52 +03:00
dbus QDBusSignature: accept empty strings as valid 2024-05-10 13:17:20 -07:00
gui Move popup management from QApplication to QGuiApplication 2024-05-31 10:40:31 -07:00
guiapplauncher Convert "Color Editor Factory" Example to snippets 2024-04-19 13:39:41 +02:00
network QFormData(Part)Builder: simplify filename formatting 2024-05-30 20:52:42 +02:00
opengl
other a11y: Notify of name change when setting window title used as a11y name 2024-05-22 08:50:31 +02:00
printsupport Change license for tests files 2024-02-04 09:56:42 +01:00
shared Introduce flag to use typographical line metrics for fonts 2024-05-31 19:30:53 +02:00
sql QSqlDatabase: Rename currentThread() to thread() 2024-05-31 19:30:53 +02:00
testlib Add copyright and licensing to build system files missing it 2024-05-21 17:23:21 +02:00
tools Add copyright and licensing to .cpp and .h files missing them 2024-05-28 09:47:01 +02:00
wasm Add copyright and licensing to build system files missing it 2024-05-21 17:23:21 +02:00
widgets widgets: Use per-surface-format RHI support and compositor 2024-06-01 00:24:34 +02:00
xml Add copyright and licensing to build system files missing it 2024-05-21 17:23:21 +02:00
CMakeLists.txt wasm: Enable qstandardpaths test 2024-05-06 16:01:28 +02:00
network-settings.h Change license for tests files 2024-02-04 09:56:42 +01:00