OpenCoverage

qsgcontextplugin.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/scenegraph/qsgcontextplugin.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2016 The Qt Company Ltd.-
4** Contact: https://www.qt.io/licensing/-
5**-
6** This file is part of the QtQuick module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see https://www.qt.io/terms-conditions. For further-
15** information use the contact form at https://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 3 as published by the Free Software-
20** Foundation and appearing in the file LICENSE.LGPL3 included in the-
21** packaging of this file. Please review the following information to-
22** ensure the GNU Lesser General Public License version 3 requirements-
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.-
24**-
25** GNU General Public License Usage-
26** Alternatively, this file may be used under the terms of the GNU-
27** General Public License version 2.0 or (at your option) the GNU General-
28** Public license version 3 or any later version approved by the KDE Free-
29** Qt Foundation. The licenses are as published by the Free Software-
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3-
31** included in the packaging of this file. Please review the following-
32** information to ensure the GNU General Public License requirements will-
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and-
34** https://www.gnu.org/licenses/gpl-3.0.html.-
35**-
36** $QT_END_LICENSE$-
37**-
38****************************************************************************/-
39-
40#include "qsgcontextplugin_p.h"-
41#include <QtQuick/private/qsgcontext_p.h>-
42#include <QtGui/qguiapplication.h>-
43#include <QtCore/private/qfactoryloader_p.h>-
44#include <QtCore/qlibraryinfo.h>-
45-
46// Built-in adaptations-
47#include <QtQuick/private/qsgsoftwareadaptation_p.h>-
48#if QT_CONFIG(opengl)-
49#include <QtQuick/private/qsgdefaultcontext_p.h>-
50#endif-
51-
52#include <QtGui/private/qguiapplication_p.h>-
53#include <QtGui/qpa/qplatformintegration.h>-
54-
55QT_BEGIN_NAMESPACE-
56-
57Q_DECLARE_LOGGING_CATEGORY(QSG_LOG_INFO)-
58-
59QSGContextPlugin::QSGContextPlugin(QObject *parent)-
60 : QObject(parent)-
61{-
62}
executed 202 times by 94 tests: end of block
Executed by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_nodestest
  • tst_qqmlcomponent
  • tst_qqmldebugjs
  • tst_qqmlimport
  • tst_qqmltypeloader
  • tst_qquickaccessible
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdesignersupport
  • tst_qquickdrag
  • tst_qquickdraghandler
  • ...
202
63-
64QSGContextPlugin::~QSGContextPlugin()-
65{-
66}-
67-
68#if QT_CONFIG(library)-
69Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
never executed: end of block
never executed: guard.store(QtGlobalStatic::Destroyed);
never executed: return &holder.value;
guard.load() =...c::InitializedDescription
TRUEnever evaluated
FALSEnever evaluated
0
70 (QSGContextFactoryInterface_iid, QLatin1String("/scenegraph")))-
71#endif-
72-
73struct QSGAdaptationBackendData-
74{-
75 QSGAdaptationBackendData();-
76-
77 bool tried = false;-
78 QSGContextFactoryInterface *factory = nullptr;-
79 QString name;-
80 QSGContextFactoryInterface::Flags flags;-
81-
82 QVector<QSGContextFactoryInterface *> builtIns;-
83-
84 QString quickWindowBackendRequest;-
85};-
86-
87QSGAdaptationBackendData::QSGAdaptationBackendData()-
88 : flags(nullptr)-
89{-
90 // Fill in the table with the built-in adaptations.-
91 builtIns.append(new QSGSoftwareAdaptation);-
92}
executed 202 times by 94 tests: end of block
Executed by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_nodestest
  • tst_qqmlcomponent
  • tst_qqmldebugjs
  • tst_qqmlimport
  • tst_qqmltypeloader
  • tst_qquickaccessible
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdesignersupport
  • tst_qquickdrag
  • tst_qquickdraghandler
  • ...
202
93-
94Q_GLOBAL_STATIC(QSGAdaptationBackendData, qsg_adaptation_data)
executed 202 times by 94 tests: end of block
Executed by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_nodestest
  • tst_qqmlcomponent
  • tst_qqmldebugjs
  • tst_qqmlimport
  • tst_qqmltypeloader
  • tst_qquickaccessible
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdesignersupport
  • tst_qquickdrag
  • tst_qquickdraghandler
  • ...
executed 202 times by 94 tests: guard.store(QtGlobalStatic::Destroyed);
Executed by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_nodestest
  • tst_qqmlcomponent
  • tst_qqmldebugjs
  • tst_qqmlimport
  • tst_qqmltypeloader
  • tst_qquickaccessible
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdesignersupport
  • tst_qquickdrag
  • tst_qquickdraghandler
  • ...
executed 9518 times by 94 tests: return &holder.value;
Executed by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_nodestest
  • tst_qqmlcomponent
  • tst_qqmldebugjs
  • tst_qqmlimport
  • tst_qqmltypeloader
  • tst_qquickaccessible
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdesignersupport
  • tst_qquickdrag
  • tst_qquickdraghandler
  • ...
guard.load() =...c::InitializedDescription
TRUEevaluated 202 times by 94 tests
Evaluated by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_nodestest
  • tst_qqmlcomponent
  • tst_qqmldebugjs
  • tst_qqmlimport
  • tst_qqmltypeloader
  • tst_qquickaccessible
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdesignersupport
  • tst_qquickdrag
  • tst_qquickdraghandler
  • ...
FALSEnever evaluated
0-9518
95-
96// This only works when the backend is loaded (contextFactory() was called),-
97// otherwise the return value is 0.-
98//-
99// Note that the default (OpenGL) implementation always results in 0, custom flags-
100// can only be returned from the other (either compiled-in or plugin-based) backends.-
101QSGContextFactoryInterface::Flags qsg_backend_flags()-
102{-
103 return qsg_adaptation_data()->flags;
executed 108 times by 5 tests: return qsg_adaptation_data()->flags;
Executed by:
  • tst_examples
  • tst_qquickborderimage
  • tst_qquickitemlayer
  • tst_qquickshadereffect
  • tst_scenegraph
108
104}-
105-
106QSGAdaptationBackendData *contextFactory()-
107{-
108 QSGAdaptationBackendData *backendData = qsg_adaptation_data();-
109-
110 if (!backendData->tried) {
!backendData->triedDescription
TRUEevaluated 202 times by 94 tests
Evaluated by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_nodestest
  • tst_qqmlcomponent
  • tst_qqmldebugjs
  • tst_qqmlimport
  • tst_qqmltypeloader
  • tst_qquickaccessible
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdesignersupport
  • tst_qquickdrag
  • tst_qquickdraghandler
  • ...
FALSEevaluated 9138 times by 92 tests
Evaluated by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_nodestest
  • tst_qqmlcomponent
  • tst_qqmldebugjs
  • tst_qqmlimport
  • tst_qqmltypeloader
  • tst_qquickaccessible
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdesignersupport
  • tst_qquickdrag
  • tst_qquickdraghandler
  • ...
202-9138
111 backendData->tried = true;-
112-
113 const QStringList args = QGuiApplication::arguments();-
114 QString requestedBackend = backendData->quickWindowBackendRequest; // empty or set via QQuickWindow::setBackend()-
115-
116 for (int index = 0; index < args.count(); ++index) {
index < args.count()Description
TRUEevaluated 228 times by 94 tests
Evaluated by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_nodestest
  • tst_qqmlcomponent
  • tst_qqmldebugjs
  • tst_qqmlimport
  • tst_qqmltypeloader
  • tst_qquickaccessible
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdesignersupport
  • tst_qquickdrag
  • tst_qquickdraghandler
  • ...
FALSEevaluated 202 times by 94 tests
Evaluated by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_nodestest
  • tst_qqmlcomponent
  • tst_qqmldebugjs
  • tst_qqmlimport
  • tst_qqmltypeloader
  • tst_qquickaccessible
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdesignersupport
  • tst_qquickdrag
  • tst_qquickdraghandler
  • ...
202-228
117 if (args.at(index).startsWith(QLatin1String("--device="))) {
args.at(index)...("--device="))Description
TRUEnever evaluated
FALSEevaluated 228 times by 94 tests
Evaluated by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_nodestest
  • tst_qqmlcomponent
  • tst_qqmldebugjs
  • tst_qqmlimport
  • tst_qqmltypeloader
  • tst_qquickaccessible
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdesignersupport
  • tst_qquickdrag
  • tst_qquickdraghandler
  • ...
0-228
118 requestedBackend = args.at(index).mid(9);-
119 break;
never executed: break;
0
120 }-
121 }
executed 228 times by 94 tests: end of block
Executed by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_nodestest
  • tst_qqmlcomponent
  • tst_qqmldebugjs
  • tst_qqmlimport
  • tst_qqmltypeloader
  • tst_qquickaccessible
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdesignersupport
  • tst_qquickdrag
  • tst_qquickdraghandler
  • ...
228
122-
123 if (requestedBackend.isEmpty())
requestedBackend.isEmpty()Description
TRUEevaluated 200 times by 93 tests
Evaluated by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_nodestest
  • tst_qqmlcomponent
  • tst_qqmldebugjs
  • tst_qqmlimport
  • tst_qqmltypeloader
  • tst_qquickaccessible
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdesignersupport
  • tst_qquickdrag
  • tst_qquickdraghandler
  • ...
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickshape
2-200
124 requestedBackend = qEnvironmentVariable("QMLSCENE_DEVICE");
executed 200 times by 93 tests: requestedBackend = qEnvironmentVariable("QMLSCENE_DEVICE");
Executed by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_nodestest
  • tst_qqmlcomponent
  • tst_qqmldebugjs
  • tst_qqmlimport
  • tst_qqmltypeloader
  • tst_qquickaccessible
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdesignersupport
  • tst_qquickdrag
  • tst_qquickdraghandler
  • ...
200
125-
126 // A modern alternative. Scenegraph adaptations can represent backends-
127 // for different graphics APIs as well, instead of being specific to-
128 // some device or platform.-
129 if (requestedBackend.isEmpty())
requestedBackend.isEmpty()Description
TRUEevaluated 200 times by 93 tests
Evaluated by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_nodestest
  • tst_qqmlcomponent
  • tst_qqmldebugjs
  • tst_qqmlimport
  • tst_qqmltypeloader
  • tst_qquickaccessible
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdesignersupport
  • tst_qquickdrag
  • tst_qquickdraghandler
  • ...
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickshape
2-200
130 requestedBackend = qEnvironmentVariable("QT_QUICK_BACKEND");
executed 200 times by 93 tests: requestedBackend = qEnvironmentVariable("QT_QUICK_BACKEND");
Executed by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_nodestest
  • tst_qqmlcomponent
  • tst_qqmldebugjs
  • tst_qqmlimport
  • tst_qqmltypeloader
  • tst_qquickaccessible
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdesignersupport
  • tst_qquickdrag
  • tst_qquickdraghandler
  • ...
200
131-
132 // If this platform does not support OpenGL, and no backend has been set-
133 // default to the software renderer-
134 if (requestedBackend.isEmpty()
requestedBackend.isEmpty()Description
TRUEevaluated 200 times by 93 tests
Evaluated by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_nodestest
  • tst_qqmlcomponent
  • tst_qqmldebugjs
  • tst_qqmlimport
  • tst_qqmltypeloader
  • tst_qquickaccessible
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdesignersupport
  • tst_qquickdrag
  • tst_qquickdraghandler
  • ...
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickshape
2-200
135 && !QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::OpenGL)) {
!QGuiApplicati...ation::OpenGL)Description
TRUEnever evaluated
FALSEevaluated 200 times by 93 tests
Evaluated by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_nodestest
  • tst_qqmlcomponent
  • tst_qqmldebugjs
  • tst_qqmlimport
  • tst_qqmltypeloader
  • tst_qquickaccessible
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdesignersupport
  • tst_qquickdrag
  • tst_qquickdraghandler
  • ...
0-200
136 requestedBackend = QString::fromLocal8Bit("software");-
137 }
never executed: end of block
0
138-
139 if (!requestedBackend.isEmpty()) {
!requestedBackend.isEmpty()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickshape
FALSEevaluated 200 times by 93 tests
Evaluated by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_nodestest
  • tst_qqmlcomponent
  • tst_qqmldebugjs
  • tst_qqmlimport
  • tst_qqmltypeloader
  • tst_qquickaccessible
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdesignersupport
  • tst_qquickdrag
  • tst_qquickdraghandler
  • ...
2-200
140 qCDebug(QSG_LOG_INFO, "Loading backend %s", qUtf8Printable(requestedBackend));
never executed: QMessageLogger(__FILE__, 140, __PRETTY_FUNCTION__, QSG_LOG_INFO().categoryName()).debug("Loading backend %s", QtPrivate::asString(requestedBackend).toUtf8().constData());
qt_category_enabledDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickshape
0-2
141-
142 // First look for a built-in adaptation.-
143 for (QSGContextFactoryInterface *builtInBackend : qAsConst(backendData->builtIns)) {-
144 if (builtInBackend->keys().contains(requestedBackend)) {
builtInBackend...uestedBackend)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickshape
FALSEnever evaluated
0-2
145 backendData->factory = builtInBackend;-
146 backendData->name = requestedBackend;-
147 backendData->flags = backendData->factory->flags(requestedBackend);-
148 break;
executed 2 times by 1 test: break;
Executed by:
  • tst_qquickshape
2
149 }-
150 }
never executed: end of block
0
151-
152#if QT_CONFIG(library)-
153 // Then try the plugins.-
154 if (!backendData->factory) {
!backendData->factoryDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickshape
0-2
155 const int index = loader()->indexOf(requestedBackend);-
156 if (index != -1)
index != -1Description
TRUEnever evaluated
FALSEnever evaluated
0
157 backendData->factory = qobject_cast<QSGContextFactoryInterface*>(loader()->instance(index));
never executed: backendData->factory = qobject_cast<QSGContextFactoryInterface*>(loader()->instance(index));
0
158 if (backendData->factory) {
backendData->factoryDescription
TRUEnever evaluated
FALSEnever evaluated
0
159 backendData->name = requestedBackend;-
160 backendData->flags = backendData->factory->flags(requestedBackend);-
161 }
never executed: end of block
0
162 if (!backendData->factory) {
!backendData->factoryDescription
TRUEnever evaluated
FALSEnever evaluated
0
163 qWarning("Could not create scene graph context for backend '%s'"-
164 " - check that plugins are installed correctly in %s",-
165 qPrintable(requestedBackend),-
166 qPrintable(QLibraryInfo::location(QLibraryInfo::PluginsPath)));-
167 }
never executed: end of block
0
168 }
never executed: end of block
0
169#endif // library-
170 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickshape
2
171 }
executed 202 times by 94 tests: end of block
Executed by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_nodestest
  • tst_qqmlcomponent
  • tst_qqmldebugjs
  • tst_qqmlimport
  • tst_qqmltypeloader
  • tst_qquickaccessible
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdesignersupport
  • tst_qquickdrag
  • tst_qquickdraghandler
  • ...
202
172-
173 return backendData;
executed 9340 times by 94 tests: return backendData;
Executed by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_nodestest
  • tst_qqmlcomponent
  • tst_qqmldebugjs
  • tst_qqmlimport
  • tst_qqmltypeloader
  • tst_qquickaccessible
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdesignersupport
  • tst_qquickdrag
  • tst_qquickdraghandler
  • ...
9340
174}-
175-
176-
177-
178/*!-
179 \fn QSGContext *QSGContext::createDefaultContext()-
180-
181 Creates a default scene graph context for the current hardware.-
182 This may load a device-specific plugin.-
183*/-
184QSGContext *QSGContext::createDefaultContext()-
185{-
186 QSGAdaptationBackendData *backendData = contextFactory();-
187 if (backendData->factory)
backendData->factoryDescription
TRUEnever evaluated
FALSEevaluated 200 times by 90 tests
Evaluated by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_nodestest
  • tst_qqmlcomponent
  • tst_qqmldebugjs
  • tst_qqmlimport
  • tst_qqmltypeloader
  • tst_qquickaccessible
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdesignersupport
  • tst_qquickdrag
  • tst_qquickdraghandler
  • ...
0-200
188 return backendData->factory->create(backendData->name);
never executed: return backendData->factory->create(backendData->name);
0
189#if QT_CONFIG(opengl)-
190 return new QSGDefaultContext();
executed 200 times by 90 tests: return new QSGDefaultContext();
Executed by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_nodestest
  • tst_qqmlcomponent
  • tst_qqmldebugjs
  • tst_qqmlimport
  • tst_qqmltypeloader
  • tst_qquickaccessible
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdesignersupport
  • tst_qquickdrag
  • tst_qquickdraghandler
  • ...
200
191#else-
192 return nullptr;-
193#endif-
194}-
195-
196-
197-
198/*!-
199 Calls into the scene graph adaptation if available and creates a texture-
200 factory. The primary purpose of this function is to reimplement hardware-
201 specific asynchronous texture frameskip-less uploads that can happen on-
202 the image providers thread.-
203 */-
204-
205QQuickTextureFactory *QSGContext::createTextureFactoryFromImage(const QImage &image)-
206{-
207 QSGAdaptationBackendData *backendData = contextFactory();-
208 if (backendData->factory)
backendData->factoryDescription
TRUEnever evaluated
FALSEevaluated 8942 times by 37 tests
Evaluated by:
  • tst_examples
  • tst_qquickage
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickellipseextruder
  • tst_qquickfriction
  • tst_qquickgravity
  • tst_qquickgroupgoal
  • tst_qquickimage
  • tst_qquickimageparticle
  • tst_qquickimageprovider
  • tst_qquickitemparticle
  • tst_qquicklineextruder
  • tst_qquickmaskextruder
  • tst_qquickparticlegroup
  • tst_qquickparticlesystem
  • tst_qquickpixmapcache
  • tst_qquickpointattractor
  • tst_qquickpointdirection
  • tst_qquickrectangleextruder
  • ...
0-8942
209 return backendData->factory->createTextureFactoryFromImage(image);
never executed: return backendData->factory->createTextureFactoryFromImage(image);
0
210 return nullptr;
executed 8942 times by 37 tests: return nullptr;
Executed by:
  • tst_examples
  • tst_qquickage
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickellipseextruder
  • tst_qquickfriction
  • tst_qquickgravity
  • tst_qquickgroupgoal
  • tst_qquickimage
  • tst_qquickimageparticle
  • tst_qquickimageprovider
  • tst_qquickitemparticle
  • tst_qquicklineextruder
  • tst_qquickmaskextruder
  • tst_qquickparticlegroup
  • tst_qquickparticlesystem
  • tst_qquickpixmapcache
  • tst_qquickpointattractor
  • tst_qquickpointdirection
  • tst_qquickrectangleextruder
  • ...
8942
211}-
212-
213-
214/*!-
215 Calls into the scene graph adaptation if available and creates a hardware-
216 specific window manager.-
217 */-
218-
219QSGRenderLoop *QSGContext::createWindowManager()-
220{-
221 QSGAdaptationBackendData *backendData = contextFactory();-
222 if (backendData->factory)
backendData->factoryDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickshape
FALSEevaluated 196 times by 89 tests
Evaluated by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_nodestest
  • tst_qqmlcomponent
  • tst_qqmldebugjs
  • tst_qqmlimport
  • tst_qqmltypeloader
  • tst_qquickaccessible
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdesignersupport
  • tst_qquickdrag
  • tst_qquickdraghandler
  • ...
2-196
223 return backendData->factory->createWindowManager();
executed 2 times by 1 test: return backendData->factory->createWindowManager();
Executed by:
  • tst_qquickshape
2
224 return nullptr;
executed 196 times by 89 tests: return nullptr;
Executed by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_nodestest
  • tst_qqmlcomponent
  • tst_qqmldebugjs
  • tst_qqmlimport
  • tst_qqmltypeloader
  • tst_qquickaccessible
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdesignersupport
  • tst_qquickdrag
  • tst_qquickdraghandler
  • ...
196
225}-
226-
227void QSGContext::setBackend(const QString &backend)-
228{-
229 QSGAdaptationBackendData *backendData = qsg_adaptation_data();-
230 if (backendData->tried)
backendData->triedDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickshape
0-2
231 qWarning("Scenegraph already initialized, setBackend() request ignored");
never executed: QMessageLogger(__FILE__, 231, __PRETTY_FUNCTION__).warning("Scenegraph already initialized, setBackend() request ignored");
0
232-
233 backendData->quickWindowBackendRequest = backend;-
234}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickshape
2
235-
236QString QSGContext::backend()-
237{-
238 QSGAdaptationBackendData *backendData = qsg_adaptation_data();-
239 if (backendData->tried)
backendData->triedDescription
TRUEevaluated 68 times by 34 tests
Evaluated by:
  • tst_examples
  • tst_qquickage
  • tst_qquickangleddirection
  • tst_qquickanimatedsprite
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickellipseextruder
  • tst_qquickfriction
  • tst_qquickgravity
  • tst_qquickgroupgoal
  • tst_qquickimage
  • tst_qquickimageparticle
  • tst_qquickitemparticle
  • tst_qquicklineextruder
  • tst_qquickmaskextruder
  • tst_qquickparticlegroup
  • tst_qquickparticlesystem
  • tst_qquickpixmapcache
  • tst_qquickpointattractor
  • tst_qquickpointdirection
  • tst_qquickrectangleextruder
  • tst_qquickshadereffect
  • tst_qquickspritegoal
  • ...
FALSEnever evaluated
0-68
240 return backendData->name;
executed 68 times by 34 tests: return backendData->name;
Executed by:
  • tst_examples
  • tst_qquickage
  • tst_qquickangleddirection
  • tst_qquickanimatedsprite
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickellipseextruder
  • tst_qquickfriction
  • tst_qquickgravity
  • tst_qquickgroupgoal
  • tst_qquickimage
  • tst_qquickimageparticle
  • tst_qquickitemparticle
  • tst_qquicklineextruder
  • tst_qquickmaskextruder
  • tst_qquickparticlegroup
  • tst_qquickparticlesystem
  • tst_qquickpixmapcache
  • tst_qquickpointattractor
  • tst_qquickpointdirection
  • tst_qquickrectangleextruder
  • tst_qquickshadereffect
  • tst_qquickspritegoal
  • ...
68
241-
242 return backendData->quickWindowBackendRequest;
never executed: return backendData->quickWindowBackendRequest;
0
243}-
244-
245QT_END_NAMESPACE-
246-
247#include "moc_qsgcontextplugin_p.cpp"-
Source codeSwitch to Preprocessed file

Generated by Squish Coco 4.2.0