Qt
6.x
The Qt SDK
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
4
#ifndef QSGRENDERLOOP_P_H
5
#define QSGRENDERLOOP_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/qimage.h>
19
#include <QtGui/qsurface.h>
20
#include <private/qtquickglobal_p.h>
21
#include <QtCore/qset.h>
22
#include <QtCore/qobject.h>
23
#include <QtCore/qcoreevent.h>
24
25
QT_BEGIN_NAMESPACE
26
27
class
QQuickWindow
;
28
class
QSGContext
;
29
class
QSGRenderContext
;
30
class
QAnimationDriver
;
31
class
QRunnable
;
32
33
class
Q_QUICK_PRIVATE_EXPORT
QSGRenderLoop
:
public
QObject
34
{
35
Q_OBJECT
36
37
public
:
38
enum
RenderLoopFlags
{
39
SupportsGrabWithoutExpose = 0x01
40
};
41
42
virtual
~QSGRenderLoop
();
43
44
virtual
void
show
(
QQuickWindow
*
window
) = 0;
45
virtual
void
hide
(
QQuickWindow
*
window
) = 0;
46
virtual
void
resize
(
QQuickWindow
*) {};
47
48
virtual
void
windowDestroyed
(
QQuickWindow
*
window
) = 0;
49
50
virtual
void
exposureChanged
(
QQuickWindow
*
window
) = 0;
51
virtual
QImage
grab
(
QQuickWindow
*
window
) = 0;
52
53
virtual
void
update
(
QQuickWindow
*
window
) = 0;
54
virtual
void
maybeUpdate
(
QQuickWindow
*
window
) = 0;
55
virtual
void
handleUpdateRequest
(
QQuickWindow
*) { }
56
57
virtual
QAnimationDriver
*
animationDriver
()
const
= 0;
58
59
virtual
QSGContext
*
sceneGraphContext
()
const
= 0;
60
virtual
QSGRenderContext
*
createRenderContext
(
QSGContext
*)
const
= 0;
61
62
virtual
void
releaseResources
(
QQuickWindow
*
window
) = 0;
63
virtual
void
postJob(
QQuickWindow
*
window
,
QRunnable
*job);
64
65
void
addWindow
(
QQuickWindow
*
win
) { m_windows.insert(
win
); }
66
void
removeWindow
(
QQuickWindow
*
win
) { m_windows.remove(
win
); }
67
QSet<QQuickWindow *>
windows
()
const
{
return
m_windows; }
68
69
virtual
QSurface::SurfaceType
windowSurfaceType()
const
;
70
71
// ### make this less of a singleton
72
static
QSGRenderLoop
*instance();
73
static
void
setInstance(
QSGRenderLoop
*instance);
74
75
virtual
bool
interleaveIncubation
()
const
{
return
false
; }
76
77
virtual
int
flags
()
const
{
return
0; }
78
79
static
void
cleanup();
80
81
void
handleContextCreationFailure(
QQuickWindow
*
window
);
82
83
Q_SIGNALS
:
84
void
timeToIncubate
();
85
86
private
:
87
static
QSGRenderLoop
*s_instance;
88
89
QSet<QQuickWindow *>
m_windows;
90
};
91
92
enum
QSGRenderLoopType
93
{
94
BasicRenderLoop
,
95
ThreadedRenderLoop
96
};
97
98
enum
QSGCustomEvents
{
99
100
// Passed from the RL to the RT when a window is removed obscured and
101
// should be removed from the render loop.
102
WM_Obscure
=
QEvent::User
+ 1,
103
104
// Passed from the RL to RT when GUI has been locked, waiting for sync
105
// (updatePaintNode())
106
WM_RequestSync
=
QEvent::User
+ 2,
107
108
// Passed by the RL to the RT to free up maybe release SG and GL contexts
109
// if no windows are rendering.
110
WM_TryRelease
=
QEvent::User
+ 4,
111
112
// Passed by the RL to the RT when a QQuickWindow::grabWindow() is
113
// called.
114
WM_Grab
=
QEvent::User
+ 5,
115
116
// Passed by the window when there is a render job to run
117
WM_PostJob
=
QEvent::User
+ 6,
118
119
// When using the QRhi this is sent upon PlatformSurfaceAboutToBeDestroyed from
120
// the event filter installed on the QQuickWindow.
121
WM_ReleaseSwapchain
=
QEvent::User
+ 7,
122
123
};
124
125
QT_END_NAMESPACE
126
127
#endif
// QSGRENDERLOOP_P_H
QAnimationDriver
\inmodule QtCore
Definition
qabstractanimation.h:107
QEvent::User
@ User
Definition
qcoreevent.h:292
QImage
\inmodule QtGui
Definition
qimage.h:37
QObject
\inmodule QtCore
Definition
qobject.h:90
QQuickWindow
\qmltype Window \instantiates QQuickWindow \inqmlmodule QtQuick
Definition
qquickwindow.h:41
QRunnable
\inmodule QtCore
Definition
qrunnable.h:18
QSGContext
The QSGContext holds the scene graph entry points for one QML engine.
Definition
qsgcontext_p.h:74
QSGRenderContext
Definition
qsgcontext_p.h:124
QSGRenderLoop
Definition
qsgrenderloop_p.h:34
QSGRenderLoop::exposureChanged
virtual void exposureChanged(QQuickWindow *window)=0
QSGRenderLoop::timeToIncubate
void timeToIncubate()
QSGRenderLoop::show
virtual void show(QQuickWindow *window)=0
QSGRenderLoop::handleUpdateRequest
virtual void handleUpdateRequest(QQuickWindow *)
Definition
qsgrenderloop_p.h:55
QSGRenderLoop::addWindow
void addWindow(QQuickWindow *win)
Definition
qsgrenderloop_p.h:65
QSGRenderLoop::releaseResources
virtual void releaseResources(QQuickWindow *window)=0
QSGRenderLoop::animationDriver
virtual QAnimationDriver * animationDriver() const =0
QSGRenderLoop::resize
virtual void resize(QQuickWindow *)
Definition
qsgrenderloop_p.h:46
QSGRenderLoop::update
virtual void update(QQuickWindow *window)=0
QSGRenderLoop::maybeUpdate
virtual void maybeUpdate(QQuickWindow *window)=0
QSGRenderLoop::createRenderContext
virtual QSGRenderContext * createRenderContext(QSGContext *) const =0
QSGRenderLoop::windowDestroyed
virtual void windowDestroyed(QQuickWindow *window)=0
QSGRenderLoop::removeWindow
void removeWindow(QQuickWindow *win)
Definition
qsgrenderloop_p.h:66
QSGRenderLoop::flags
virtual int flags() const
Definition
qsgrenderloop_p.h:77
QSGRenderLoop::windows
QSet< QQuickWindow * > windows() const
Definition
qsgrenderloop_p.h:67
QSGRenderLoop::hide
virtual void hide(QQuickWindow *window)=0
QSGRenderLoop::sceneGraphContext
virtual QSGContext * sceneGraphContext() const =0
QSGRenderLoop::interleaveIncubation
virtual bool interleaveIncubation() const
Definition
qsgrenderloop_p.h:75
QSGRenderLoop::grab
virtual QImage grab(QQuickWindow *window)=0
QSGRenderLoop::RenderLoopFlags
RenderLoopFlags
Definition
qsgrenderloop_p.h:38
QSet
Definition
qset.h:18
QSurface::SurfaceType
SurfaceType
The SurfaceType enum describes what type of surface this is.
Definition
qsurface.h:30
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qstandardpaths_haiku.cpp:21
QT_END_NAMESPACE
Definition
qsharedpointer.cpp:1545
QSGRenderLoopType
QSGRenderLoopType
Definition
qsgrenderloop_p.h:93
BasicRenderLoop
@ BasicRenderLoop
Definition
qsgrenderloop_p.h:94
ThreadedRenderLoop
@ ThreadedRenderLoop
Definition
qsgrenderloop_p.h:95
QSGCustomEvents
QSGCustomEvents
Definition
qsgrenderloop_p.h:98
WM_Obscure
@ WM_Obscure
Definition
qsgrenderloop_p.h:102
WM_Grab
@ WM_Grab
Definition
qsgrenderloop_p.h:114
WM_PostJob
@ WM_PostJob
Definition
qsgrenderloop_p.h:117
WM_TryRelease
@ WM_TryRelease
Definition
qsgrenderloop_p.h:110
WM_ReleaseSwapchain
@ WM_ReleaseSwapchain
Definition
qsgrenderloop_p.h:121
WM_RequestSync
@ WM_RequestSync
Definition
qsgrenderloop_p.h:106
Q_OBJECT
#define Q_OBJECT
Definition
qtmetamacros.h:117
Q_SIGNALS
#define Q_SIGNALS
Definition
qtmetamacros.h:45
win
QWidget * win
Definition
settings.cpp:6
window
aWidget window() -> setWindowTitle("New Window Title")
[2]
qtdeclarative
src
quick
scenegraph
qsgrenderloop_p.h
Generated by
1.9.7