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
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
26
27class QQuickWindow;
28class QSGContext;
31class QRunnable;
32
33class Q_QUICK_EXPORT QSGRenderLoop : public QObject
34{
36
37public:
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
49
52
53 virtual void update(QQuickWindow *window) = 0;
54 virtual void maybeUpdate(QQuickWindow *window) = 0;
56
57 virtual QAnimationDriver *animationDriver() const = 0;
58
59 virtual QSGContext *sceneGraphContext() const = 0;
61
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
85
86private:
87 static QSGRenderLoop *s_instance;
88
89 QSet<QQuickWindow *> m_windows;
90};
91
97
99
100// Passed from the RL to the RT when a window is removed obscured and
101// should be removed from the render loop.
103
104// Passed from the RL to RT when GUI has been locked, waiting for sync
105// (updatePaintNode())
107
108// Passed by the RL to the RT to free up maybe release SG and GL contexts
109// if no windows are rendering.
111
112// Passed by the RL to the RT when a QQuickWindow::grabWindow() is
113// called.
115
116// Passed by the window when there is a render job to run
118
119// When using the QRhi this is sent upon PlatformSurfaceAboutToBeDestroyed from
120// the event filter installed on the QQuickWindow.
122
123};
124
126
127#endif // QSGRENDERLOOP_P_H
\inmodule QtCore
\inmodule QtGui
Definition qimage.h:37
\inmodule QtCore
Definition qobject.h:103
\qmltype Window \instantiates QQuickWindow \inqmlmodule QtQuick
\inmodule QtCore
Definition qrunnable.h:18
The QSGContext holds the scene graph entry points for one QML engine.
virtual void exposureChanged(QQuickWindow *window)=0
void timeToIncubate()
virtual void show(QQuickWindow *window)=0
virtual void handleUpdateRequest(QQuickWindow *)
void addWindow(QQuickWindow *win)
virtual void releaseResources(QQuickWindow *window)=0
virtual QAnimationDriver * animationDriver() const =0
virtual void resize(QQuickWindow *)
virtual void update(QQuickWindow *window)=0
virtual void maybeUpdate(QQuickWindow *window)=0
virtual QSGRenderContext * createRenderContext(QSGContext *) const =0
virtual void windowDestroyed(QQuickWindow *window)=0
void removeWindow(QQuickWindow *win)
virtual int flags() const
QSet< QQuickWindow * > windows() const
virtual void hide(QQuickWindow *window)=0
virtual QSGContext * sceneGraphContext() const =0
virtual bool interleaveIncubation() const
virtual QImage grab(QQuickWindow *window)=0
SurfaceType
The SurfaceType enum describes what type of surface this is.
Definition qsurface.h:30
Combined button and popup list for selecting options.
QSGRenderLoopType
@ BasicRenderLoop
@ ThreadedRenderLoop
QSGCustomEvents
@ WM_Obscure
@ WM_Grab
@ WM_PostJob
@ WM_TryRelease
@ WM_ReleaseSwapchain
@ WM_RequestSync
#define Q_OBJECT
#define Q_SIGNALS
QWidget * win
Definition settings.cpp:6
aWidget window() -> setWindowTitle("New Window Title")
[2]