Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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// Qt-Security score:significant reason:default
4
9
10#include <private/qguiapplication_p.h>
11#include <qpa/qplatformintegration.h>
12
14
19
20QStringList QSGSoftwareAdaptation::keys() const
21{
22 return QStringList() << QLatin1String("software") << QLatin1String("softwarecontext");
23}
24
25QSGContext *QSGSoftwareAdaptation::create(const QString &) const
26{
27 if (!instance)
28 instance = new QSGSoftwareContext();
29 return instance;
30}
31
33{
34 // Claim we support adaptable shader effects, then return null for the
35 // shader effect node. The result is shader effects not being rendered,
36 // with the application working fine in all other respects.
37 return QSGContextFactoryInterface::SupportsShaderEffectNode;
38}
39
41{
42#if QT_CONFIG(thread)
43 static bool threaded = false;
44 static bool envChecked = false;
45 if (!envChecked) {
46 envChecked = true;
47 threaded = qgetenv("QSG_RENDER_LOOP") == "threaded";
48 }
49
50 if (threaded)
51 return new QSGSoftwareThreadedRenderLoop;
52#endif
53
54 return new QSGSoftwareRenderLoop();
55}
56
57QSGSoftwareContext *QSGSoftwareAdaptation::instance = nullptr;
58
59QT_END_NAMESPACE
QObject * parent
Definition qobject.h:74
\inmodule QtCore
Definition qobject.h:106
QSGContext * create(const QString &key) const override
QSGContextFactoryInterface::Flags flags(const QString &key) const override
QSGRenderLoop * createWindowManager() override
Combined button and popup list for selecting options.