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 QQUICKRENDERCONTROL_H
5#define QQUICKRENDERCONTROL_H
6
7#include <QtCore/qobject.h>
8#include <QtQuick/qtquickglobal.h>
9#include <QtGui/qimage.h>
10
11QT_BEGIN_NAMESPACE
12
13class QQuickWindow;
14class QOpenGLContext;
15class QQuickRenderControlPrivate;
16class QThread;
17class QRhi;
18class QRhiCommandBuffer;
19
20class Q_QUICK_EXPORT QQuickRenderControl : public QObject
21{
22 Q_OBJECT
23
24public:
25 explicit QQuickRenderControl(QObject *parent = nullptr);
26 ~QQuickRenderControl() override;
27
28 void prepareThread(QThread *targetThread);
29
30 void setSamples(int sampleCount);
31 int samples() const;
32
33 bool initialize();
34
35 void invalidate();
36
37 void beginFrame();
38 void endFrame();
39
40 void polishItems();
41 bool sync();
42 void render();
43
44 static QWindow *renderWindowFor(QQuickWindow *win, QPoint *offset = nullptr);
45 virtual QWindow *renderWindow(QPoint *offset) { Q_UNUSED(offset); return nullptr; }
46
47 QQuickWindow *window() const;
48
49 QRhi *rhi() const;
50 QRhiCommandBuffer *commandBuffer() const;
51
52protected:
53 explicit QQuickRenderControl(QQuickRenderControlPrivate &dd, QObject *parent = nullptr);
54
55Q_SIGNALS:
56 void renderRequested();
57 void sceneChanged();
58
59private:
60 Q_DECLARE_PRIVATE(QQuickRenderControl)
61};
62
63QT_END_NAMESPACE
64
65#endif // QQUICKRENDERCONTROL_H
66

source code of qtdeclarative/src/quick/items/qquickrendercontrol.h