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 QSGSOFTWARERENDERLOOP_H
5#define QSGSOFTWARERENDERLOOP_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 <private/qsgrenderloop_p.h>
19
20QT_BEGIN_NAMESPACE
21
22class QBackingStore;
23
24class QSGSoftwareRenderLoop : public QSGRenderLoop
25{
26 Q_OBJECT
27public:
28 QSGSoftwareRenderLoop();
29 ~QSGSoftwareRenderLoop();
30
31 void show(QQuickWindow *window) override;
32 void hide(QQuickWindow *window) override;
33
34 void windowDestroyed(QQuickWindow *window) override;
35
36 void renderWindow(QQuickWindow *window, bool isNewExpose = false);
37 void exposureChanged(QQuickWindow *window) override;
38 QImage grab(QQuickWindow *window) override;
39
40 void maybeUpdate(QQuickWindow *window) override;
41 void update(QQuickWindow *window) override { maybeUpdate(window); } // identical for this implementation.
42 void handleUpdateRequest(QQuickWindow *) override;
43
44 void releaseResources(QQuickWindow *) override { }
45
46 QSurface::SurfaceType windowSurfaceType() const override;
47
48 QAnimationDriver *animationDriver() const override { return 0; }
49
50 QSGContext *sceneGraphContext() const override;
51 QSGRenderContext *createRenderContext(QSGContext *) const override { return rc; }
52
53 struct WindowData {
54 bool updatePending : 1;
55 bool grabOnly : 1;
56 };
57
58 QHash<QQuickWindow *, WindowData> m_windows;
59 QHash<QQuickWindow *, QBackingStore *> m_backingStores;
60
61 QSGContext *sg;
62 QSGRenderContext *rc;
63
64 QImage grabContent;
65};
66
67QT_END_NAMESPACE
68
69#endif // QSGSOFTWARERENDERLOOP_H
70

source code of qtdeclarative/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop_p.h