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
qsgsoftwareadaptation.cpp
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
8
9#include <private/qguiapplication_p.h>
10#include <qpa/qplatformintegration.h>
11
13
18
20{
21 return QStringList() << QLatin1String("software") << QLatin1String("softwarecontext");
22}
23
25{
26 if (!instance)
27 instance = new QSGSoftwareContext();
28 return instance;
29}
30
31QSGContextFactoryInterface::Flags QSGSoftwareAdaptation::flags(const QString &) const
32{
33 // Claim we support adaptable shader effects, then return null for the
34 // shader effect node. The result is shader effects not being rendered,
35 // with the application working fine in all other respects.
37}
38
40{
41#if QT_CONFIG(thread)
42 static bool threaded = false;
43 static bool envChecked = false;
44 if (!envChecked) {
45 envChecked = true;
46 threaded = qgetenv("QSG_RENDER_LOOP") == "threaded";
47 }
48
49 if (threaded)
51#endif
52
53 return new QSGSoftwareRenderLoop();
54}
55
56QSGSoftwareContext *QSGSoftwareAdaptation::instance = nullptr;
57
\inmodule QtCore
Definition qobject.h:103
The QSGContext holds the scene graph entry points for one QML engine.
QStringList keys() const override
QSGContext * create(const QString &key) const override
QSGContextFactoryInterface::Flags flags(const QString &key) const override
QSGSoftwareAdaptation(QObject *parent=nullptr)
QSGRenderLoop * createWindowManager() override
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Combined button and popup list for selecting options.
QList< QString > QStringList
Constructs a string list that contains the given string, str.
QLatin1StringView QLatin1String
Definition qstringfwd.h:31
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)