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
8
9#include <private/qguiapplication_p.h>
10#include <qpa/qplatformintegration.h>
11
13
18
19QStringList QSGSoftwareAdaptation::keys() const
20{
21 return QStringList() << QLatin1String("software") << QLatin1String("softwarecontext");
22}
23
24QSGContext *QSGSoftwareAdaptation::create(const QString &) const
25{
26 if (!instance)
27 instance = new QSGSoftwareContext();
28 return instance;
29}
30
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.
36 return QSGContextFactoryInterface::SupportsShaderEffectNode;
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)
50 return new QSGSoftwareThreadedRenderLoop;
51#endif
52
53 return new QSGSoftwareRenderLoop();
54}
55
56QSGSoftwareContext *QSGSoftwareAdaptation::instance = nullptr;
57
58QT_END_NAMESPACE
QObject * parent
Definition qobject.h:73
\inmodule QtCore
Definition qobject.h:103
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.