Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/scenegraph/util/qsgengine.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||
2 | - | |||||||||||||
3 | - | |||||||||||||
4 | - | |||||||||||||
5 | - | |||||||||||||
6 | - | |||||||||||||
7 | QSGEnginePrivate::QSGEnginePrivate() | - | ||||||||||||
8 | : sgContext(QSGContext::createDefaultContext()) | - | ||||||||||||
9 | , sgRenderContext(sgContext.data()->createRenderContext()) | - | ||||||||||||
10 | { | - | ||||||||||||
11 | } never executed: end of block | 0 | ||||||||||||
12 | - | |||||||||||||
13 | - | |||||||||||||
14 | - | |||||||||||||
15 | - | |||||||||||||
16 | QSGEngine::QSGEngine(QObject *parent) | - | ||||||||||||
17 | : QObject(*(new QSGEnginePrivate), parent) | - | ||||||||||||
18 | { | - | ||||||||||||
19 | } never executed: end of block | 0 | ||||||||||||
20 | - | |||||||||||||
21 | - | |||||||||||||
22 | - | |||||||||||||
23 | - | |||||||||||||
24 | QSGEngine::~QSGEngine() | - | ||||||||||||
25 | { | - | ||||||||||||
26 | } | - | ||||||||||||
27 | - | |||||||||||||
28 | - | |||||||||||||
29 | - | |||||||||||||
30 | - | |||||||||||||
31 | - | |||||||||||||
32 | - | |||||||||||||
33 | - | |||||||||||||
34 | void QSGEngine::initialize(QOpenGLContext *context) | - | ||||||||||||
35 | { | - | ||||||||||||
36 | QSGEnginePrivate * const d = d_func(); | - | ||||||||||||
37 | - | |||||||||||||
38 | if (context
| 0 | ||||||||||||
39 | QMessageLogger(__FILE__, 123, __PRETTY_FUNCTION__).warning("WARNING: The context must be current before calling QSGEngine::initialize."); | - | ||||||||||||
40 | return; never executed: return; | 0 | ||||||||||||
41 | } | - | ||||||||||||
42 | - | |||||||||||||
43 | if (d->sgRenderContext
| 0 | ||||||||||||
44 | d->sgRenderContext->setAttachToGraphicsContext(false); | - | ||||||||||||
45 | d->sgRenderContext->initialize(context); | - | ||||||||||||
46 | - | |||||||||||||
47 | if (context
| 0 | ||||||||||||
48 | connect(context, &QOpenGLContext::aboutToBeDestroyed, this, &QSGEngine::invalidate); never executed: connect(context, &QOpenGLContext::aboutToBeDestroyed, this, &QSGEngine::invalidate); | 0 | ||||||||||||
49 | - | |||||||||||||
50 | } never executed: end of block | 0 | ||||||||||||
51 | } never executed: end of block | 0 | ||||||||||||
52 | - | |||||||||||||
53 | - | |||||||||||||
54 | - | |||||||||||||
55 | - | |||||||||||||
56 | - | |||||||||||||
57 | - | |||||||||||||
58 | - | |||||||||||||
59 | void QSGEngine::invalidate() | - | ||||||||||||
60 | { | - | ||||||||||||
61 | QSGEnginePrivate * const d = d_func(); | - | ||||||||||||
62 | d->sgRenderContext->invalidate(); | - | ||||||||||||
63 | } never executed: end of block | 0 | ||||||||||||
64 | QSGAbstractRenderer *QSGEngine::createRenderer() const | - | ||||||||||||
65 | { | - | ||||||||||||
66 | const QSGEnginePrivate * const d = d_func(); | - | ||||||||||||
67 | if (!d->sgRenderContext->isValid()
| 0 | ||||||||||||
68 | return never executed: nullptr;return nullptr; never executed: return nullptr; | 0 | ||||||||||||
69 | - | |||||||||||||
70 | QSGRenderer *renderer = d->sgRenderContext->createRenderer(); | - | ||||||||||||
71 | renderer->setCustomRenderMode(qgetenv("QSG_VISUALIZE")); | - | ||||||||||||
72 | return never executed: renderer;return renderer; never executed: return renderer; | 0 | ||||||||||||
73 | } | - | ||||||||||||
74 | QSGTexture *QSGEngine::createTextureFromImage(const QImage &image, CreateTextureOptions options) const | - | ||||||||||||
75 | { | - | ||||||||||||
76 | const QSGEnginePrivate * const d = d_func(); | - | ||||||||||||
77 | if (!d->sgRenderContext->isValid()
| 0 | ||||||||||||
78 | return never executed: nullptr;return nullptr; never executed: return nullptr; | 0 | ||||||||||||
79 | uint flags = 0; | - | ||||||||||||
80 | if (options & TextureCanUseAtlas
never executed: flags |= QSGRenderContext::CreateTexture_Atlas; | 0 | ||||||||||||
81 | if (!(options & TextureIsOpaque)
never executed: flags |= QSGRenderContext::CreateTexture_Alpha; | 0 | ||||||||||||
82 | return never executed: d->sgRenderContext->createTexture(image, flags);return d->sgRenderContext->createTexture(image, flags); never executed: return d->sgRenderContext->createTexture(image, flags); | 0 | ||||||||||||
83 | } | - | ||||||||||||
84 | QSGTexture *QSGEngine::createTextureFromId(uint id, const QSize &size, CreateTextureOptions options) const | - | ||||||||||||
85 | { | - | ||||||||||||
86 | const QSGEnginePrivate * const d = d_func(); | - | ||||||||||||
87 | if (d->sgRenderContext->isValid()
| 0 | ||||||||||||
88 | QSGPlainTexture *texture = new QSGPlainTexture(); | - | ||||||||||||
89 | texture->setTextureId(id); | - | ||||||||||||
90 | texture->setHasAlphaChannel(options & TextureHasAlphaChannel); | - | ||||||||||||
91 | texture->setOwnsTexture(options & TextureOwnsGLTexture); | - | ||||||||||||
92 | texture->setTextureSize(size); | - | ||||||||||||
93 | return never executed: texture;return texture; never executed: return texture; | 0 | ||||||||||||
94 | } | - | ||||||||||||
95 | return never executed: nullptr;return nullptr; never executed: return nullptr; | 0 | ||||||||||||
96 | } | - | ||||||||||||
97 | - | |||||||||||||
98 | - | |||||||||||||
99 | - | |||||||||||||
100 | - | |||||||||||||
101 | - | |||||||||||||
102 | - | |||||||||||||
103 | - | |||||||||||||
104 | QSGRendererInterface *QSGEngine::rendererInterface() const | - | ||||||||||||
105 | { | - | ||||||||||||
106 | const QSGEnginePrivate * const d = d_func(); | - | ||||||||||||
107 | return never executed: d->sgRenderContext->isValid()return d->sgRenderContext->isValid() ? d->sgRenderContext->sceneGraphContext()->rendererInterface(d->sgRenderContext.data()) : nullptr; never executed: return d->sgRenderContext->isValid() ? d->sgRenderContext->sceneGraphContext()->rendererInterface(d->sgRenderContext.data()) : nullptr; | 0 | ||||||||||||
108 | ? d->sgRenderContext->sceneGraphContext()->rendererInterface(d->sgRenderContext.data()) never executed: return d->sgRenderContext->isValid() ? d->sgRenderContext->sceneGraphContext()->rendererInterface(d->sgRenderContext.data()) : nullptr; | 0 | ||||||||||||
109 | : nullptr; never executed: return d->sgRenderContext->isValid() ? d->sgRenderContext->sceneGraphContext()->rendererInterface(d->sgRenderContext.data()) : nullptr; | 0 | ||||||||||||
110 | } | - | ||||||||||||
111 | QSGRectangleNode *QSGEngine::createRectangleNode() const | - | ||||||||||||
112 | { | - | ||||||||||||
113 | const QSGEnginePrivate * const d = d_func(); | - | ||||||||||||
114 | return never executed: d->sgRenderContext->isValid() ? d->sgRenderContext->sceneGraphContext()->createRectangleNode() : nullptr;return d->sgRenderContext->isValid() ? d->sgRenderContext->sceneGraphContext()->createRectangleNode() : nullptr; never executed: return d->sgRenderContext->isValid() ? d->sgRenderContext->sceneGraphContext()->createRectangleNode() : nullptr; | 0 | ||||||||||||
115 | } | - | ||||||||||||
116 | QSGImageNode *QSGEngine::createImageNode() const | - | ||||||||||||
117 | { | - | ||||||||||||
118 | const QSGEnginePrivate * const d = d_func(); | - | ||||||||||||
119 | return never executed: d->sgRenderContext->isValid() ? d->sgRenderContext->sceneGraphContext()->createImageNode() : nullptr;return d->sgRenderContext->isValid() ? d->sgRenderContext->sceneGraphContext()->createImageNode() : nullptr; never executed: return d->sgRenderContext->isValid() ? d->sgRenderContext->sceneGraphContext()->createImageNode() : nullptr; | 0 | ||||||||||||
120 | } | - | ||||||||||||
121 | - | |||||||||||||
122 | - | |||||||||||||
123 | - | |||||||||||||
124 | - | |||||||||||||
125 | - | |||||||||||||
126 | - | |||||||||||||
127 | - | |||||||||||||
128 | QSGNinePatchNode *QSGEngine::createNinePatchNode() const | - | ||||||||||||
129 | { | - | ||||||||||||
130 | const QSGEnginePrivate * const d = d_func(); | - | ||||||||||||
131 | return never executed: d->sgRenderContext->isValid() ? d->sgRenderContext->sceneGraphContext()->createNinePatchNode() : nullptr;return d->sgRenderContext->isValid() ? d->sgRenderContext->sceneGraphContext()->createNinePatchNode() : nullptr; never executed: return d->sgRenderContext->isValid() ? d->sgRenderContext->sceneGraphContext()->createNinePatchNode() : nullptr; | 0 | ||||||||||||
132 | } | - | ||||||||||||
133 | - | |||||||||||||
134 | - | |||||||||||||
135 | - | |||||||||||||
Switch to Source code | Preprocessed file |