diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-06-04 10:24:46 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-06-04 10:28:48 +0200 |
commit | 9556f6d075b61fa95d6e1057f305e522a26f71d6 (patch) | |
tree | 53190472453390810c47b9b5a47b23188a00267e /src/quick/scenegraph | |
parent | 42ffe9b193a5bd958b0853233fd0d94170722bd1 (diff) | |
parent | 1fd0cdc6a2e01775d8a79c6614910cc5a2fbf2b3 (diff) | |
download | qtdeclarative-9556f6d075b61fa95d6e1057f305e522a26f71d6.tar.gz qtdeclarative-9556f6d075b61fa95d6e1057f305e522a26f71d6.tar.bz2 qtdeclarative-9556f6d075b61fa95d6e1057f305e522a26f71d6.zip |
Merge remote-tracking branch 'origin/5.5' into dev
Conflicts:
src/qml/jsruntime/qv4engine_p.h
src/quick/items/qquickitemsmodule.cpp
src/quick/items/qquicktext.cpp
src/quick/util/qquickpixmapcache.cpp
tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
Change-Id: I90ecaad6a4bfaa4f36149a7463f4d7141f4a516a
Diffstat (limited to 'src/quick/scenegraph')
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp | 8 | ||||
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h | 7 | ||||
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgnode.cpp | 14 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgcontext.cpp | 10 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgrenderloop.cpp | 3 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgthreadedrenderloop.cpp | 7 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgwindowsrenderloop.cpp | 1 |
7 files changed, 30 insertions, 20 deletions
diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp index f056b1767..81e72b794 100644 --- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp +++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp @@ -1696,8 +1696,8 @@ void Renderer::uploadMergedElement(Element *e, int vaOffset, char **vertexData, if (((const QMatrix4x4_Accessor &) localx).flagBits == 1) { for (int i=0; i<vCount; ++i) { Pt *p = (Pt *) vdata; - p->x += ((QMatrix4x4_Accessor &) localx).m[3][0]; - p->y += ((QMatrix4x4_Accessor &) localx).m[3][1]; + p->x += ((const QMatrix4x4_Accessor &) localx).m[3][0]; + p->y += ((const QMatrix4x4_Accessor &) localx).m[3][1]; vdata += vSize; } } else if (((const QMatrix4x4_Accessor &) localx).flagBits > 1) { @@ -1938,11 +1938,11 @@ void Renderer::uploadBatch(Batch *b) if (attr.isVertexCoordinate) dump << "* "; for (int t=0; t<attr.tupleSize; ++t) - dump << *(float *)(vd + offset + t * sizeof(float)) << " "; + dump << *(const float *)(vd + offset + t * sizeof(float)) << " "; } else if (attr.type == GL_UNSIGNED_BYTE) { dump << "ubyte "; for (int t=0; t<attr.tupleSize; ++t) - dump << *(unsigned char *)(vd + offset + t * sizeof(unsigned char)) << " "; + dump << *(const unsigned char *)(vd + offset + t * sizeof(unsigned char)) << " "; } dump << ") "; offset += attr.tupleSize * size_of_type(attr.type); diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h b/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h index 8996d5a09..f87dd75c8 100644 --- a/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h +++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h @@ -85,7 +85,12 @@ public: for (int i=0; i<PageSize; ++i) blocks[i] = i; } - Type *at(uint index) const + const Type *at(uint index) const + { + return (Type *) &data[index * sizeof(Type)]; + } + + Type *at(uint index) { return (Type *) &data[index * sizeof(Type)]; } diff --git a/src/quick/scenegraph/coreapi/qsgnode.cpp b/src/quick/scenegraph/coreapi/qsgnode.cpp index e52713e80..71f4f62db 100644 --- a/src/quick/scenegraph/coreapi/qsgnode.cpp +++ b/src/quick/scenegraph/coreapi/qsgnode.cpp @@ -1457,7 +1457,7 @@ QDebug operator<<(QDebug d, const QSGGeometryNode *n) d << "Geometry(null)"; return d; } - d << "GeometryNode(" << hex << (void *) n << dec; + d << "GeometryNode(" << hex << (const void *) n << dec; const QSGGeometry *g = n->geometry(); @@ -1508,7 +1508,7 @@ QDebug operator<<(QDebug d, const QSGClipNode *n) d << "ClipNode(null)"; return d; } - d << "ClipNode(" << hex << (void *) n << dec; + d << "ClipNode(" << hex << (const void *) n << dec; if (n->childCount()) d << "children=" << n->childCount(); @@ -1531,7 +1531,7 @@ QDebug operator<<(QDebug d, const QSGTransformNode *n) } const QMatrix4x4 m = n->matrix(); d << "TransformNode("; - d << hex << (void *) n << dec; + d << hex << (const void *) n << dec; if (m.isIdentity()) d << "identity"; else if (m.determinant() == 1 && m(0, 0) == 1 && m(1, 1) == 1 && m(2, 2) == 1) @@ -1553,7 +1553,7 @@ QDebug operator<<(QDebug d, const QSGOpacityNode *n) return d; } d << "OpacityNode("; - d << hex << (void *) n << dec; + d << hex << (const void *) n << dec; d << "opacity=" << n->opacity() << "combined=" << n->combinedOpacity() << (n->isSubtreeBlocked() ? "*BLOCKED*" : ""); @@ -1571,7 +1571,7 @@ QDebug operator<<(QDebug d, const QSGRootNode *n) d << "RootNode(null)"; return d; } - d << "RootNode" << hex << (void *) n << (n->isSubtreeBlocked() ? "*BLOCKED*" : ""); + d << "RootNode" << hex << (const void *) n << (n->isSubtreeBlocked() ? "*BLOCKED*" : ""); #ifdef QSG_RUNTIME_DESCRIPTION d << QSGNodePrivate::description(n); #endif @@ -1604,7 +1604,7 @@ QDebug operator<<(QDebug d, const QSGNode *n) d << static_cast<const QSGOpacityNode *>(n); break; case QSGNode::RenderNodeType: - d << "RenderNode(" << hex << (void *) n << dec + d << "RenderNode(" << hex << (const void *) n << dec << "flags=" << (int) n->flags() << dec << (n->isSubtreeBlocked() ? "*BLOCKED*" : ""); #ifdef QSG_RUNTIME_DESCRIPTION @@ -1613,7 +1613,7 @@ QDebug operator<<(QDebug d, const QSGNode *n) d << ')'; break; default: - d << "Node(" << hex << (void *) n << dec + d << "Node(" << hex << (const void *) n << dec << "flags=" << (int) n->flags() << dec << (n->isSubtreeBlocked() ? "*BLOCKED*" : ""); #ifdef QSG_RUNTIME_DESCRIPTION diff --git a/src/quick/scenegraph/qsgcontext.cpp b/src/quick/scenegraph/qsgcontext.cpp index dd071d757..418d571ae 100644 --- a/src/quick/scenegraph/qsgcontext.cpp +++ b/src/quick/scenegraph/qsgcontext.cpp @@ -315,11 +315,11 @@ QSGContext::QSGContext(QObject *parent) : // Adds compatibility with Qt 5.3 and earlier's QSG_RENDER_TIMING if (qEnvironmentVariableIsSet("QSG_RENDER_TIMING")) { - ((QLoggingCategory &) QSG_LOG_TIME_GLYPH()).setEnabled(QtDebugMsg, true); - ((QLoggingCategory &) QSG_LOG_TIME_TEXTURE()).setEnabled(QtDebugMsg, true); - ((QLoggingCategory &) QSG_LOG_TIME_RENDERER()).setEnabled(QtDebugMsg, true); - ((QLoggingCategory &) QSG_LOG_TIME_RENDERLOOP()).setEnabled(QtDebugMsg, true); - ((QLoggingCategory &) QSG_LOG_TIME_COMPILATION()).setEnabled(QtDebugMsg, true); + const_cast<QLoggingCategory &>(QSG_LOG_TIME_GLYPH()).setEnabled(QtDebugMsg, true); + const_cast<QLoggingCategory &>(QSG_LOG_TIME_TEXTURE()).setEnabled(QtDebugMsg, true); + const_cast<QLoggingCategory &>(QSG_LOG_TIME_RENDERER()).setEnabled(QtDebugMsg, true); + const_cast<QLoggingCategory &>(QSG_LOG_TIME_RENDERLOOP()).setEnabled(QtDebugMsg, true); + const_cast<QLoggingCategory &>(QSG_LOG_TIME_COMPILATION()).setEnabled(QtDebugMsg, true); } } diff --git a/src/quick/scenegraph/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp index 0c39602da..6c7fb89b6 100644 --- a/src/quick/scenegraph/qsgrenderloop.cpp +++ b/src/quick/scenegraph/qsgrenderloop.cpp @@ -168,7 +168,7 @@ QSGRenderLoop *QSGRenderLoop::instance() // For compatibility with 5.3 and earlier's QSG_INFO environment variables if (qEnvironmentVariableIsSet("QSG_INFO")) - ((QLoggingCategory &) QSG_LOG_INFO()).setEnabled(QtDebugMsg, true); + const_cast<QLoggingCategory &>(QSG_LOG_INFO()).setEnabled(QtDebugMsg, true); s_instance = QSGContext::createWindowManager(); @@ -336,6 +336,7 @@ void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window) if (!gl) { gl = new QOpenGLContext(); gl->setFormat(window->requestedFormat()); + gl->setScreen(window->screen()); if (qt_gl_global_share_context()) gl->setShareContext(qt_gl_global_share_context()); if (!gl->create()) { diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp index 95a0d0f02..074e7633d 100644 --- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp +++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp @@ -910,9 +910,11 @@ void QSGThreadedRenderLoop::handleExposure(QQuickWindow *window) w->thread->window = window; if (w->window->width() <= 0 || w->window->height() <= 0 - || !w->window->geometry().intersects(w->window->screen()->availableGeometry())) { + || (w->window->isTopLevel() && !w->window->geometry().intersects(w->window->screen()->availableGeometry()))) { #ifndef QT_NO_DEBUG - qWarning("QSGThreadedRenderLoop: expose event received for window with invalid geometry."); + qWarning().noquote().nospace() << "QSGThreadedRenderLoop: expose event received for window " + << w->window << " with invalid geometry: " << w->window->geometry() + << " on " << w->window->screen(); #endif } @@ -931,6 +933,7 @@ void QSGThreadedRenderLoop::handleExposure(QQuickWindow *window) if (qt_gl_global_share_context()) w->thread->gl->setShareContext(qt_gl_global_share_context()); w->thread->gl->setFormat(w->window->requestedFormat()); + w->thread->gl->setScreen(w->window->screen()); if (!w->thread->gl->create()) { const bool isEs = w->thread->gl->isOpenGLES(); delete w->thread->gl; diff --git a/src/quick/scenegraph/qsgwindowsrenderloop.cpp b/src/quick/scenegraph/qsgwindowsrenderloop.cpp index 309e877da..c571e6001 100644 --- a/src/quick/scenegraph/qsgwindowsrenderloop.cpp +++ b/src/quick/scenegraph/qsgwindowsrenderloop.cpp @@ -162,6 +162,7 @@ void QSGWindowsRenderLoop::show(QQuickWindow *window) RLDEBUG(" - creating GL context"); m_gl = new QOpenGLContext(); m_gl->setFormat(window->requestedFormat()); + m_gl->setScreen(window->screen()); if (qt_gl_global_share_context()) m_gl->setShareContext(qt_gl_global_share_context()); bool created = m_gl->create(); |