Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qbackingstorerhisupport_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QBACKINGSTORERHISUPPORT_P_H
5#define QBACKINGSTORERHISUPPORT_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtGui/private/qtguiglobal_p.h>
19#include <QtGui/qwindow.h>
20#include <QtGui/qsurfaceformat.h>
21#include <QtGui/qoffscreensurface.h>
22#include <rhi/qrhi.h>
23#include <qpa/qplatformbackingstore.h>
24
26
27class Q_GUI_EXPORT QBackingStoreRhiSupport
28{
29public:
31
32 void reset();
33
34 void setFormat(const QSurfaceFormat &format) { m_format = format; }
35 void setWindow(QWindow *window) { m_window = window; }
37
38 bool create();
39
40 QRhiSwapChain *swapChainForWindow(QWindow *window);
41
42 static QSurface::SurfaceType surfaceTypeForConfig(const QPlatformBackingStoreRhiConfig &config);
43
44 static bool checkForceRhi(QPlatformBackingStoreRhiConfig *outConfig, QSurface::SurfaceType *outType);
45
47
48 QRhi *rhi() const { return m_rhi; }
49
50private:
51 QSurfaceFormat m_format;
52 QWindow *m_window = nullptr;
54 QRhi *m_rhi = nullptr;
55 QOffscreenSurface *m_openGLFallbackSurface = nullptr;
56 struct SwapchainData {
57 QRhiSwapChain *swapchain = nullptr;
58 QRhiRenderPassDescriptor *renderPassDescriptor = nullptr;
59 QObject *windowWatcher = nullptr;
60 void reset();
61 };
62 QHash<QWindow *, SwapchainData> m_swapchains;
64};
65
67{
68public:
69 QBackingStoreRhiSupportWindowWatcher(QBackingStoreRhiSupport *rhiSupport) : m_rhiSupport(rhiSupport) { }
70 bool eventFilter(QObject *obj, QEvent *ev) override;
71private:
72 QBackingStoreRhiSupport *m_rhiSupport;
73};
74
76
77#endif // QBACKINGSTORERHISUPPORT_P_H
QBackingStoreRhiSupportWindowWatcher(QBackingStoreRhiSupport *rhiSupport)
bool eventFilter(QObject *obj, QEvent *ev) override
Filters events if this object has been installed as an event filter for the watched object.
void setConfig(const QPlatformBackingStoreRhiConfig &config)
void setFormat(const QSurfaceFormat &format)
\inmodule QtCore
Definition qcoreevent.h:45
\inmodule QtCore
Definition qobject.h:103
\inmodule QtGui
\inmodule QtGui
Definition qrhi.h:1142
\inmodule QtGui
Definition qrhi.h:1549
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
Definition qrhi.h:1804
Implementation
Describes which graphics API-specific backend gets used by a QRhi instance.
Definition qrhi.h:1806
The QSurfaceFormat class represents the format of a QSurface. \inmodule QtGui.
SurfaceType
The SurfaceType enum describes what type of surface this is.
Definition qsurface.h:30
\inmodule QtGui
Definition qwindow.h:63
Combined button and popup list for selecting options.
EGLConfig config
GLint GLsizei GLsizei GLenum format
GLhandleARB obj
[2]
GLboolean reset
aWidget window() -> setWindowTitle("New Window Title")
[2]
QNetworkRequestFactory api
[0]
view create()