aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-04-30 10:44:29 +0200
committerLars Knoll <lars.knoll@qt.io>2017-05-02 08:40:48 +0200
commitc3e1e6390edbc28e6e528f401eb4f3639661302b (patch)
tree5c882bfe7fced9b357e80a6b56ccdc88de8a41c3 /src/quick/scenegraph
parent9709d04ba7787c853a1ddbeed0347eab27c0924f (diff)
parent6a2febc680e163e56eb61d322d156dbf6fb07e0e (diff)
Merge remote-tracking branch 'origin/5.9' into dev
Diffstat (limited to 'src/quick/scenegraph')
-rw-r--r--src/quick/scenegraph/adaptations/software/qsgsoftwarecontext.cpp2
-rw-r--r--src/quick/scenegraph/adaptations/software/qsgsoftwarelayer.cpp2
-rw-r--r--src/quick/scenegraph/adaptations/software/qsgsoftwarepixmaptexture.cpp2
-rw-r--r--src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp2
-rw-r--r--src/quick/scenegraph/adaptations/software/qsgsoftwarethreadedrenderloop.cpp1
-rw-r--r--src/quick/scenegraph/coreapi/qsgabstractrenderer.cpp2
-rw-r--r--src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp43
-rw-r--r--src/quick/scenegraph/qsgadaptationlayer.cpp2
-rw-r--r--src/quick/scenegraph/qsgcontext.cpp1
-rw-r--r--src/quick/scenegraph/qsgcontext_p.h1
-rw-r--r--src/quick/scenegraph/qsgcontextplugin.cpp11
-rw-r--r--src/quick/scenegraph/qsgdefaultlayer.cpp2
-rw-r--r--src/quick/scenegraph/qsgdefaultrendercontext.cpp2
-rw-r--r--src/quick/scenegraph/qsgrenderloop.cpp1
-rw-r--r--src/quick/scenegraph/qsgthreadedrenderloop.cpp1
-rw-r--r--src/quick/scenegraph/qsgwindowsrenderloop.cpp2
-rw-r--r--src/quick/scenegraph/util/qsgatlastexture.cpp4
-rw-r--r--src/quick/scenegraph/util/qsgengine.cpp2
-rw-r--r--src/quick/scenegraph/util/qsgtexture.cpp5
-rw-r--r--src/quick/scenegraph/util/qsgtextureprovider.cpp2
20 files changed, 76 insertions, 14 deletions
diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarecontext.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarecontext.cpp
index d71b0c3e2a..aa850a80db 100644
--- a/src/quick/scenegraph/adaptations/software/qsgsoftwarecontext.cpp
+++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarecontext.cpp
@@ -222,3 +222,5 @@ void *QSGSoftwareContext::getResource(QQuickWindow *window, Resource resource) c
}
QT_END_NAMESPACE
+
+#include "moc_qsgsoftwarecontext_p.cpp"
diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarelayer.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarelayer.cpp
index 7020283898..2954f591ad 100644
--- a/src/quick/scenegraph/adaptations/software/qsgsoftwarelayer.cpp
+++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarelayer.cpp
@@ -259,3 +259,5 @@ void QSGSoftwareLayer::grab()
}
QT_END_NAMESPACE
+
+#include "moc_qsgsoftwarelayer_p.cpp"
diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarepixmaptexture.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarepixmaptexture.cpp
index 534a0a4ec6..16e3a111ae 100644
--- a/src/quick/scenegraph/adaptations/software/qsgsoftwarepixmaptexture.cpp
+++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarepixmaptexture.cpp
@@ -86,3 +86,5 @@ void QSGSoftwarePixmapTexture::bind()
}
QT_END_NAMESPACE
+
+#include "moc_qsgsoftwarepixmaptexture_p.cpp"
diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp
index b3b8274a73..962db20cbc 100644
--- a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp
+++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp
@@ -269,3 +269,5 @@ void QSGSoftwareRenderLoop::handleUpdateRequest(QQuickWindow *window)
}
QT_END_NAMESPACE
+
+#include "moc_qsgsoftwarerenderloop_p.cpp"
diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarethreadedrenderloop.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarethreadedrenderloop.cpp
index 682f89721e..d2186e7cf1 100644
--- a/src/quick/scenegraph/adaptations/software/qsgsoftwarethreadedrenderloop.cpp
+++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarethreadedrenderloop.cpp
@@ -1000,5 +1000,6 @@ void QSGSoftwareThreadedRenderLoop::polishAndSync(QSGSoftwareThreadedRenderLoop:
}
#include "qsgsoftwarethreadedrenderloop.moc"
+#include "moc_qsgsoftwarethreadedrenderloop_p.cpp"
QT_END_NAMESPACE
diff --git a/src/quick/scenegraph/coreapi/qsgabstractrenderer.cpp b/src/quick/scenegraph/coreapi/qsgabstractrenderer.cpp
index eeed986939..3d4ce24716 100644
--- a/src/quick/scenegraph/coreapi/qsgabstractrenderer.cpp
+++ b/src/quick/scenegraph/coreapi/qsgabstractrenderer.cpp
@@ -314,3 +314,5 @@ QSGAbstractRenderer::ClearMode QSGAbstractRenderer::clearMode() const
*/
QT_END_NAMESPACE
+
+#include "moc_qsgabstractrenderer.cpp"
diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
index 14f8514289..b8ebeaca63 100644
--- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
+++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
@@ -299,7 +299,7 @@ void Updater::updateStates(QSGNode *n)
qDebug() << " - transforms have changed";
if (sn->dirtyState & (QSGNode::DirtyOpacity << 16))
qDebug() << " - opacity has changed";
- if (sn->dirtyState & (QSGNode::DirtyForceUpdate << 16))
+ if (uint(sn->dirtyState) & uint(QSGNode::DirtyForceUpdate << 16))
qDebug() << " - forceupdate";
}
@@ -2029,6 +2029,15 @@ Renderer::ClipType Renderer::updateStencilClip(const QSGClipNode *clip)
GLuint vbo = 0;
int vboSize = 0;
+ bool useVBO = false;
+ QOpenGLContext *ctx = QOpenGLContext::currentContext();
+ QSurfaceFormat::OpenGLContextProfile profile = ctx->format().profile();
+
+ if (!ctx->isOpenGLES() && profile == QSurfaceFormat::CoreProfile) {
+ // VBO are more expensive, so only use them if we must.
+ useVBO = true;
+ }
+
glDisable(GL_SCISSOR_TEST);
m_currentStencilValue = 0;
@@ -2113,20 +2122,27 @@ Renderer::ClipType Renderer::updateStencilClip(const QSGClipNode *clip)
Q_ASSERT(g->attributeCount() > 0);
const QSGGeometry::Attribute *a = g->attributes();
- if (!vbo)
- glGenBuffers(1, &vbo);
+ const GLvoid *pointer;
+ if (!useVBO) {
+ pointer = g->vertexData();
+ } else {
+ if (!vbo)
+ glGenBuffers(1, &vbo);
- glBindBuffer(GL_ARRAY_BUFFER, vbo);
+ glBindBuffer(GL_ARRAY_BUFFER, vbo);
- const int vertexByteSize = g->sizeOfVertex() * g->vertexCount();
- if (vboSize < vertexByteSize) {
- vboSize = vertexByteSize;
- glBufferData(GL_ARRAY_BUFFER, vertexByteSize, g->vertexData(), GL_STATIC_DRAW);
- } else {
- glBufferSubData(GL_ARRAY_BUFFER, 0, vertexByteSize, g->vertexData());
+ const int vertexByteSize = g->sizeOfVertex() * g->vertexCount();
+ if (vboSize < vertexByteSize) {
+ vboSize = vertexByteSize;
+ glBufferData(GL_ARRAY_BUFFER, vertexByteSize, g->vertexData(), GL_STATIC_DRAW);
+ } else {
+ glBufferSubData(GL_ARRAY_BUFFER, 0, vertexByteSize, g->vertexData());
+ }
+
+ pointer = 0;
}
- glVertexAttribPointer(0, a->tupleSize, a->type, GL_FALSE, g->sizeOfVertex(), 0);
+ glVertexAttribPointer(0, a->tupleSize, a->type, GL_FALSE, g->sizeOfVertex(), pointer);
m_clipProgram.setUniformValue(m_clipMatrixId, m);
if (g->indexCount()) {
@@ -2135,7 +2151,8 @@ Renderer::ClipType Renderer::updateStencilClip(const QSGClipNode *clip)
glDrawArrays(g->drawingMode(), 0, g->vertexCount());
}
- glBindBuffer(GL_ARRAY_BUFFER, 0);
+ if (useVBO)
+ glBindBuffer(GL_ARRAY_BUFFER, 0);
++m_currentStencilValue;
}
@@ -3204,3 +3221,5 @@ void Renderer::visualize()
QT_END_NAMESPACE
}
+
+#include "moc_qsgbatchrenderer_p.cpp"
diff --git a/src/quick/scenegraph/qsgadaptationlayer.cpp b/src/quick/scenegraph/qsgadaptationlayer.cpp
index f90706affe..c64360f955 100644
--- a/src/quick/scenegraph/qsgadaptationlayer.cpp
+++ b/src/quick/scenegraph/qsgadaptationlayer.cpp
@@ -567,3 +567,5 @@ QDebug operator<<(QDebug debug, const QSGShaderEffectNode::VariableData &vd)
#endif
QT_END_NAMESPACE
+
+#include "moc_qsgadaptationlayer_p.cpp"
diff --git a/src/quick/scenegraph/qsgcontext.cpp b/src/quick/scenegraph/qsgcontext.cpp
index ff2379ecb5..2be84f4aec 100644
--- a/src/quick/scenegraph/qsgcontext.cpp
+++ b/src/quick/scenegraph/qsgcontext.cpp
@@ -413,5 +413,6 @@ void QSGRenderContext::textureFactoryDestroyed(QObject *o)
}
#include "qsgcontext.moc"
+#include "moc_qsgcontext_p.cpp"
QT_END_NAMESPACE
diff --git a/src/quick/scenegraph/qsgcontext_p.h b/src/quick/scenegraph/qsgcontext_p.h
index bd10453131..6ff8f4a76e 100644
--- a/src/quick/scenegraph/qsgcontext_p.h
+++ b/src/quick/scenegraph/qsgcontext_p.h
@@ -144,6 +144,7 @@ public:
static QSGRenderLoop *createWindowManager();
static void setBackend(const QString &backend);
+ static QString backend();
};
class Q_QUICK_PRIVATE_EXPORT QSGRenderContext : public QObject
diff --git a/src/quick/scenegraph/qsgcontextplugin.cpp b/src/quick/scenegraph/qsgcontextplugin.cpp
index 635308c38a..b8b5141957 100644
--- a/src/quick/scenegraph/qsgcontextplugin.cpp
+++ b/src/quick/scenegraph/qsgcontextplugin.cpp
@@ -232,4 +232,15 @@ void QSGContext::setBackend(const QString &backend)
backendData->quickWindowBackendRequest = backend;
}
+QString QSGContext::backend()
+{
+ QSGAdaptationBackendData *backendData = qsg_adaptation_data();
+ if (backendData->tried)
+ return backendData->name;
+
+ return backendData->quickWindowBackendRequest;
+}
+
QT_END_NAMESPACE
+
+#include "moc_qsgcontextplugin_p.cpp"
diff --git a/src/quick/scenegraph/qsgdefaultlayer.cpp b/src/quick/scenegraph/qsgdefaultlayer.cpp
index 6fa9dd6359..86d74acf54 100644
--- a/src/quick/scenegraph/qsgdefaultlayer.cpp
+++ b/src/quick/scenegraph/qsgdefaultlayer.cpp
@@ -472,3 +472,5 @@ QRectF QSGDefaultLayer::normalizedTextureSubRect() const
m_mirrorHorizontal ? -1 : 1,
m_mirrorVertical ? 1 : -1);
}
+
+#include "moc_qsgdefaultlayer_p.cpp"
diff --git a/src/quick/scenegraph/qsgdefaultrendercontext.cpp b/src/quick/scenegraph/qsgdefaultrendercontext.cpp
index 7542068a53..bffffc36ad 100644
--- a/src/quick/scenegraph/qsgdefaultrendercontext.cpp
+++ b/src/quick/scenegraph/qsgdefaultrendercontext.cpp
@@ -301,3 +301,5 @@ QSGDistanceFieldGlyphCache *QSGDefaultRenderContext::distanceFieldGlyphCache(con
return cache;
}
+
+#include "moc_qsgdefaultrendercontext_p.cpp"
diff --git a/src/quick/scenegraph/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp
index 293a706c2e..c11b698a03 100644
--- a/src/quick/scenegraph/qsgrenderloop.cpp
+++ b/src/quick/scenegraph/qsgrenderloop.cpp
@@ -501,5 +501,6 @@ void QSGGuiThreadRenderLoop::handleUpdateRequest(QQuickWindow *window)
#endif
#include "qsgrenderloop.moc"
+#include "moc_qsgrenderloop_p.cpp"
QT_END_NAMESPACE
diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
index 560fddd580..7d77e52b5f 100644
--- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp
+++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
@@ -1309,5 +1309,6 @@ void QSGThreadedRenderLoop::postJob(QQuickWindow *window, QRunnable *job)
}
#include "qsgthreadedrenderloop.moc"
+#include "moc_qsgthreadedrenderloop_p.cpp"
QT_END_NAMESPACE
diff --git a/src/quick/scenegraph/qsgwindowsrenderloop.cpp b/src/quick/scenegraph/qsgwindowsrenderloop.cpp
index eff6763a16..e16f7ea966 100644
--- a/src/quick/scenegraph/qsgwindowsrenderloop.cpp
+++ b/src/quick/scenegraph/qsgwindowsrenderloop.cpp
@@ -494,3 +494,5 @@ void QSGWindowsRenderLoop::renderWindow(QQuickWindow *window)
}
QT_END_NAMESPACE
+
+#include "moc_qsgwindowsrenderloop_p.cpp"
diff --git a/src/quick/scenegraph/util/qsgatlastexture.cpp b/src/quick/scenegraph/util/qsgatlastexture.cpp
index c864ea9496..22f0b13f46 100644
--- a/src/quick/scenegraph/util/qsgatlastexture.cpp
+++ b/src/quick/scenegraph/util/qsgatlastexture.cpp
@@ -140,7 +140,7 @@ Atlas::Atlas(const QSize &size)
if (QOpenGLContext::currentContext()->isOpenGLES()) {
#endif
-#if defined(Q_OS_ANDROID)
+#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
QString *deviceName =
static_cast<QString *>(QGuiApplication::platformNativeInterface()->nativeResourceForIntegration("AndroidDeviceName"));
static bool wrongfullyReportsBgra8888Support = deviceName != 0
@@ -533,3 +533,5 @@ QSGTexture *Texture::removedFromAtlas() const
}
QT_END_NAMESPACE
+
+#include "moc_qsgatlastexture_p.cpp"
diff --git a/src/quick/scenegraph/util/qsgengine.cpp b/src/quick/scenegraph/util/qsgengine.cpp
index 259e45c978..dffe199224 100644
--- a/src/quick/scenegraph/util/qsgengine.cpp
+++ b/src/quick/scenegraph/util/qsgengine.cpp
@@ -265,3 +265,5 @@ QSGNinePatchNode *QSGEngine::createNinePatchNode() const
}
QT_END_NAMESPACE
+
+#include "moc_qsgengine.cpp"
diff --git a/src/quick/scenegraph/util/qsgtexture.cpp b/src/quick/scenegraph/util/qsgtexture.cpp
index bfe5642deb..1c19876a76 100644
--- a/src/quick/scenegraph/util/qsgtexture.cpp
+++ b/src/quick/scenegraph/util/qsgtexture.cpp
@@ -797,7 +797,7 @@ void QSGPlainTexture::bind()
GLenum externalFormat = GL_RGBA;
GLenum internalFormat = GL_RGBA;
-#if defined(Q_OS_ANDROID)
+#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
QString *deviceName =
static_cast<QString *>(QGuiApplication::platformNativeInterface()->nativeResourceForIntegration("AndroidDeviceName"));
static bool wrongfullyReportsBgra8888Support = deviceName != 0
@@ -904,3 +904,6 @@ void QSGPlainTexture::bind()
QT_END_NAMESPACE
+
+#include "moc_qsgtexture.cpp"
+#include "moc_qsgtexture_p.cpp"
diff --git a/src/quick/scenegraph/util/qsgtextureprovider.cpp b/src/quick/scenegraph/util/qsgtextureprovider.cpp
index 2f6a789222..d67d9cfdbc 100644
--- a/src/quick/scenegraph/util/qsgtextureprovider.cpp
+++ b/src/quick/scenegraph/util/qsgtextureprovider.cpp
@@ -62,3 +62,5 @@ QT_BEGIN_NAMESPACE
*/
QT_END_NAMESPACE
+
+#include "moc_qsgtextureprovider.cpp"