Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qsgrenderloop_p.h
Go to the documentation of this file.
1
// Copyright (C) 2016 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
// Qt-Security score:significant reason:default
4
5
#
ifndef
QSGRENDERLOOP_P_H
6
#
define
QSGRENDERLOOP_P_H
7
8
//
9
// W A R N I N G
10
// -------------
11
//
12
// This file is not part of the Qt API. It exists purely as an
13
// implementation detail. This header file may change from version to
14
// version without notice, or even be removed.
15
//
16
// We mean it.
17
//
18
19
#
include
<
QtGui
/
qimage
.
h
>
20
#
include
<
QtGui
/
qsurface
.
h
>
21
#
include
<
private
/
qtquickglobal_p
.
h
>
22
#
include
<
QtCore
/
qset
.
h
>
23
#
include
<
QtCore
/
qobject
.
h
>
24
#
include
<
QtCore
/
qcoreevent
.
h
>
25
26
QT_BEGIN_NAMESPACE
27
28
class
QQuickWindow;
29
class
QSGContext;
30
class
QSGRenderContext;
31
class
QAnimationDriver;
32
class
QRunnable;
33
34
class
Q_QUICK_EXPORT
QSGRenderLoop
:
public
QObject
35
{
36
Q_OBJECT
37
38
public
:
39
enum
RenderLoopFlags {
40
SupportsGrabWithoutExpose = 0x01
41
};
42
43
virtual
~QSGRenderLoop();
44
45
virtual
void
show(QQuickWindow *window) = 0;
46
virtual
void
hide(QQuickWindow *window) = 0;
47
virtual
void
resize(QQuickWindow *) {};
48
49
virtual
void
windowDestroyed(QQuickWindow *window) = 0;
50
51
virtual
void
exposureChanged(QQuickWindow *window) = 0;
52
virtual
QImage grab(QQuickWindow *window) = 0;
53
54
virtual
void
update(QQuickWindow *window) = 0;
55
virtual
void
maybeUpdate(QQuickWindow *window) = 0;
56
virtual
void
handleUpdateRequest(QQuickWindow *) { }
57
58
virtual
QAnimationDriver *animationDriver()
const
= 0;
59
60
virtual
QSGContext *sceneGraphContext()
const
= 0;
61
virtual
QSGRenderContext *createRenderContext(QSGContext *)
const
= 0;
62
63
virtual
void
releaseResources(QQuickWindow *window) = 0;
64
virtual
void
postJob(QQuickWindow *window, QRunnable *job);
65
66
void
addWindow(QQuickWindow *win) { m_windows.insert(win); }
67
void
removeWindow(QQuickWindow *win) { m_windows.remove(win); }
68
QSet<QQuickWindow *> windows()
const
{
return
m_windows; }
69
70
virtual
QSurface::SurfaceType windowSurfaceType()
const
;
71
72
// ### make this less of a singleton
73
static
QSGRenderLoop *instance();
74
static
void
setInstance(QSGRenderLoop *instance);
75
76
virtual
bool
interleaveIncubation()
const
{
return
false
; }
77
78
virtual
int
flags()
const
{
return
0; }
79
80
static
void
cleanup();
81
82
void
handleContextCreationFailure(QQuickWindow *window);
83
84
Q_SIGNALS:
85
void
timeToIncubate();
86
87
private
:
88
static
QSGRenderLoop *s_instance;
89
90
QSet<QQuickWindow *> m_windows;
91
};
92
93
enum
QSGRenderLoopType
94
{
95
BasicRenderLoop
,
96
ThreadedRenderLoop
97
};
98
99
enum
QSGCustomEvents
{
100
101
// Passed from the RL to the RT when a window is removed obscured and
102
// should be removed from the render loop.
103
WM_Obscure
=
QEvent
::
User
+ 1,
104
105
// Passed from the RL to RT when GUI has been locked, waiting for sync
106
// (updatePaintNode())
107
WM_RequestSync
=
QEvent
::
User
+ 2,
108
109
// Passed from the RL to the RT when a window is exposed
110
WM_Exposed
=
QEvent
::
User
+ 3,
111
112
// Passed by the RL to the RT to free up maybe release SG and GL contexts
113
// if no windows are rendering.
114
WM_TryRelease
=
QEvent
::
User
+ 4,
115
116
// Passed by the RL to the RT when a QQuickWindow::grabWindow() is
117
// called.
118
WM_Grab
=
QEvent
::
User
+ 5,
119
120
// Passed by the window when there is a render job to run
121
WM_PostJob
=
QEvent
::
User
+ 6,
122
123
// When using the QRhi this is sent upon PlatformSurfaceAboutToBeDestroyed from
124
// the event filter installed on the QQuickWindow.
125
WM_ReleaseSwapchain
=
QEvent
::
User
+ 7,
126
127
};
128
129
QT_END_NAMESPACE
130
131
#
endif
// QSGRENDERLOOP_P_H
QSGGuiThreadRenderLoop
Definition
qsgrenderloop.cpp:115
QSGGuiThreadRenderLoop::animationDriver
QAnimationDriver * animationDriver() const override
Definition
qsgrenderloop.cpp:136
QSGGuiThreadRenderLoop::update
void update(QQuickWindow *window) override
Definition
qsgrenderloop.cpp:131
QSGGuiThreadRenderLoop::renderWindow
void renderWindow(QQuickWindow *window)
Definition
qsgrenderloop.cpp:572
QSGGuiThreadRenderLoop::releaseSwapchain
void releaseSwapchain(QQuickWindow *window)
Definition
qsgrenderloop.cpp:428
QSGGuiThreadRenderLoop::sg
QSGContext * sg
Definition
qsgrenderloop.cpp:170
QSGGuiThreadRenderLoop::show
void show(QQuickWindow *window) override
Definition
qsgrenderloop.cpp:318
QSGGuiThreadRenderLoop::eventFilter
bool eventFilter(QObject *watched, QEvent *event) override
Filters events if this object has been installed as an event filter for the watched object.
Definition
qsgrenderloop.cpp:440
QSGGuiThreadRenderLoop::~QSGGuiThreadRenderLoop
~QSGGuiThreadRenderLoop()
Definition
qsgrenderloop.cpp:312
QSGGuiThreadRenderLoop::createRenderContext
QSGRenderContext * createRenderContext(QSGContext *) const override
Definition
qsgrenderloop.cpp:859
QSGGuiThreadRenderLoop::windowDestroyed
void windowDestroyed(QQuickWindow *window) override
Definition
qsgrenderloop.cpp:336
QSGGuiThreadRenderLoop::ensureRhi
bool ensureRhi(QQuickWindow *window, WindowData &data)
Definition
qsgrenderloop.cpp:459
QSGGuiThreadRenderLoop::handleDeviceLoss
void handleDeviceLoss()
Definition
qsgrenderloop.cpp:404
QSGGuiThreadRenderLoop::offscreenSurface
QOffscreenSurface * offscreenSurface
Definition
qsgrenderloop.cpp:169
QSGGuiThreadRenderLoop::releaseResources
void releaseResources(QQuickWindow *) override
Definition
qsgrenderloop.cpp:866
QSGGuiThreadRenderLoop::exposureChanged
void exposureChanged(QQuickWindow *window) override
Definition
qsgrenderloop.cpp:774
QSGGuiThreadRenderLoop::sceneGraphContext
QSGContext * sceneGraphContext() const override
Definition
qsgrenderloop.cpp:854
QSGGuiThreadRenderLoop::m_windows
QHash< QQuickWindow *, WindowData > m_windows
Definition
qsgrenderloop.cpp:167
QSGGuiThreadRenderLoop::swRastFallbackDueToSwapchainFailure
bool swRastFallbackDueToSwapchainFailure
Definition
qsgrenderloop.cpp:175
QSGGuiThreadRenderLoop::m_inPolish
bool m_inPolish
Definition
qsgrenderloop.cpp:173
QSGGuiThreadRenderLoop::pendingRenderContexts
QSet< QSGRenderContext * > pendingRenderContexts
Definition
qsgrenderloop.cpp:171
QSGGuiThreadRenderLoop::handleUpdateRequest
void handleUpdateRequest(QQuickWindow *) override
Definition
qsgrenderloop.cpp:878
QSGGuiThreadRenderLoop::hide
void hide(QQuickWindow *window) override
Definition
qsgrenderloop.cpp:327
QSGGuiThreadRenderLoop::grab
QImage grab(QQuickWindow *window) override
Definition
qsgrenderloop.cpp:804
QSGGuiThreadRenderLoop::maybeUpdate
void maybeUpdate(QQuickWindow *window) override
Definition
qsgrenderloop.cpp:832
QSGGuiThreadRenderLoop::teardownGraphics
void teardownGraphics()
Definition
qsgrenderloop.cpp:387
QSGRenderLoop
Definition
qsgrenderloop_p.h:35
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
qsg_useConsistentTiming
bool qsg_useConsistentTiming()
Definition
qsgcontext.cpp:75
ENABLE_DEFAULT_BACKEND
#define ENABLE_DEFAULT_BACKEND
Definition
qsgrenderloop.cpp:42
QSGRenderLoopType
QSGRenderLoopType
Definition
qsgrenderloop_p.h:94
BasicRenderLoop
@ BasicRenderLoop
Definition
qsgrenderloop_p.h:95
ThreadedRenderLoop
@ ThreadedRenderLoop
Definition
qsgrenderloop_p.h:96
QSGCustomEvents
QSGCustomEvents
Definition
qsgrenderloop_p.h:99
WM_Exposed
@ WM_Exposed
Definition
qsgrenderloop_p.h:110
WM_Obscure
@ WM_Obscure
Definition
qsgrenderloop_p.h:103
WM_Grab
@ WM_Grab
Definition
qsgrenderloop_p.h:118
WM_PostJob
@ WM_PostJob
Definition
qsgrenderloop_p.h:121
WM_TryRelease
@ WM_TryRelease
Definition
qsgrenderloop_p.h:114
WM_ReleaseSwapchain
@ WM_ReleaseSwapchain
Definition
qsgrenderloop_p.h:125
WM_RequestSync
@ WM_RequestSync
Definition
qsgrenderloop_p.h:107
DEFINE_BOOL_CONFIG_OPTION
DEFINE_BOOL_CONFIG_OPTION(forceDiskCache, QML_FORCE_DISK_CACHE)
QSGGuiThreadRenderLoop::WindowData
Definition
qsgrenderloop.cpp:147
QSGGuiThreadRenderLoop::WindowData::ownRhi
bool ownRhi
Definition
qsgrenderloop.cpp:155
QSGGuiThreadRenderLoop::WindowData::updatePending
bool updatePending
Definition
qsgrenderloop.cpp:159
QSGGuiThreadRenderLoop::WindowData::WindowData
WindowData()
Definition
qsgrenderloop.cpp:148
QSGGuiThreadRenderLoop::WindowData::sampleCount
int sampleCount
Definition
qsgrenderloop.cpp:158
QSGGuiThreadRenderLoop::WindowData::rc
QSGRenderContext * rc
Definition
qsgrenderloop.cpp:156
QSGGuiThreadRenderLoop::WindowData::swapchainOutOfDate
bool swapchainOutOfDate
Definition
qsgrenderloop.cpp:162
QSGGuiThreadRenderLoop::WindowData::rhiDoomed
bool rhiDoomed
Definition
qsgrenderloop.cpp:161
QSGGuiThreadRenderLoop::WindowData::rhiDeviceLost
bool rhiDeviceLost
Definition
qsgrenderloop.cpp:160
QSGGuiThreadRenderLoop::WindowData::rhi
QRhi * rhi
Definition
qsgrenderloop.cpp:154
QSGGuiThreadRenderLoop::WindowData::timeBetweenRenders
QElapsedTimer timeBetweenRenders
Definition
qsgrenderloop.cpp:157
qtdeclarative
src
quick
scenegraph
qsgrenderloop_p.h
Generated on
for Qt by
1.18.0