diff options
-rw-r--r-- | .qmake.conf | 2 | ||||
-rw-r--r-- | dist/changes-5.10.0 | 22 | ||||
-rw-r--r-- | dist/changes-5.10.1 | 26 | ||||
-rw-r--r-- | src/imports/qtcanvas3d/canvasrenderer.cpp | 36 | ||||
-rw-r--r-- | src/imports/qtcanvas3d/context3d.cpp | 45 | ||||
-rw-r--r-- | src/imports/qtcanvas3d/doc/qtcanvas3d.qdocconf | 2 | ||||
-rw-r--r-- | src/imports/qtcanvas3d/glcommandqueue.cpp | 4 | ||||
-rw-r--r-- | src/imports/qtcanvas3d/glcommandqueue_p.h | 2 | ||||
-rw-r--r-- | src/imports/qtcanvas3d/teximage3d.cpp | 21 |
9 files changed, 100 insertions, 60 deletions
diff --git a/.qmake.conf b/.qmake.conf index 07299be..ff8a3a7 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -2,6 +2,6 @@ load(qt_build_config) DEFINES += QT_NO_FOREACH -MODULE_VERSION = 5.9.5 +MODULE_VERSION = 5.11.0 CMAKE_MODULE_TESTS=- diff --git a/dist/changes-5.10.0 b/dist/changes-5.10.0 new file mode 100644 index 0000000..a41f02a --- /dev/null +++ b/dist/changes-5.10.0 @@ -0,0 +1,22 @@ +Qt 5.10 introduces many new features and improvements as well as bugfixes +over the 5.9.x series. For more details, refer to the online documentation +included in this distribution. The documentation is also available online: + +http://doc.qt.io/qt-5/index.html + +The Qt version 5.10 series is binary compatible with the 5.10.x series. +Applications compiled for 5.9 will continue to run with 5.10. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + +https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* Qt 5.10.0 Changes * +**************************************************************************** + + - This release contains only minor code improvements. diff --git a/dist/changes-5.10.1 b/dist/changes-5.10.1 new file mode 100644 index 0000000..695c4e3 --- /dev/null +++ b/dist/changes-5.10.1 @@ -0,0 +1,26 @@ +Qt 5.10.1 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.10.0. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + +http://doc.qt.io/qt-5/index.html + +The Qt version 5.10 series is binary compatible with the 5.9.x series. +Applications compiled for 5.9 will continue to run with 5.10. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + +https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +This release contains all fixes included in the Qt 5.9.4 release. + +**************************************************************************** +* Qt 5.10.1 Changes * +**************************************************************************** + + - This release contains only minor code improvements. diff --git a/src/imports/qtcanvas3d/canvasrenderer.cpp b/src/imports/qtcanvas3d/canvasrenderer.cpp index db16051..95f77ad 100644 --- a/src/imports/qtcanvas3d/canvasrenderer.cpp +++ b/src/imports/qtcanvas3d/canvasrenderer.cpp @@ -809,21 +809,33 @@ void CanvasRenderer::createFBOs() void CanvasRenderer::transferCommands() { if (m_glContext) { - const int count = m_commandQueue.queuedCount(); - if (count > m_executeQueue.size()) - m_executeQueue.resize(count); + const int commandQueueCount = m_commandQueue.queuedCount(); + const int finalExecuteQueueCount = m_executeQueueCount + commandQueueCount; + if (finalExecuteQueueCount > m_executeQueue.size()) + m_executeQueue.resize(finalExecuteQueueCount); if (m_renderTarget == Canvas::RenderTargetOffscreenBuffer) { - m_executeQueueCount = count; - m_commandQueue.transferCommands(m_executeQueue); + m_commandQueue.transferCommands(m_executeQueue.data() + m_executeQueueCount); + m_executeQueueCount = finalExecuteQueueCount; } else { m_clearMask = m_commandQueue.resetClearMask(); - // Use previous frame count and indices if no new commands, otherwise reset values - if (count) { - deleteCommandData(); - m_executeQueueCount = count; - m_executeStartIndex = 0; - m_executeEndIndex = 0; - m_commandQueue.transferCommands(m_executeQueue); + if (commandQueueCount) { + if (m_executeStartIndex) { + // The commands in the execute queue have been executed at least once, + // so we can assume the new commands represent a new frame. Delete old commands. + deleteCommandData(); + m_executeStartIndex = 0; + m_executeEndIndex = 0; + m_commandQueue.transferCommands(m_executeQueue.data()); + m_executeQueueCount = commandQueueCount; + } else { + // Append new commands to existing non-executed commands + m_commandQueue.transferCommands(m_executeQueue.data() + m_executeQueueCount); + m_executeQueueCount = finalExecuteQueueCount; + } + } else { + // No new commands. Leave m_executeQueue alone, and let the renderer + // re-render the commands between m_executeStartIndex and m_executeEndIndex + // for the next frame. } } } diff --git a/src/imports/qtcanvas3d/context3d.cpp b/src/imports/qtcanvas3d/context3d.cpp index 7b2e590..bad4e4f 100644 --- a/src/imports/qtcanvas3d/context3d.cpp +++ b/src/imports/qtcanvas3d/context3d.cpp @@ -4422,10 +4422,7 @@ QJSValue CanvasContext::getParameter(glEnums pname) QV4::ScopedFunctionObject constructor(scope, m_v4engine->typedArrayCtors[ QV4::Heap::TypedArray::Float32Array]); - QV4::ScopedCallData callData(scope, 1); - callData->args[0] = buffer; - constructor->construct(scope, callData); - return QJSValue(m_v4engine, scope.result.asReturnedValue()); + return QJSValue(m_v4engine, constructor->callAsConstructor(buffer, 1)); } // Float32Array (with 4 values) @@ -4443,10 +4440,7 @@ QJSValue CanvasContext::getParameter(glEnums pname) QV4::ScopedFunctionObject constructor(scope, m_v4engine->typedArrayCtors[ QV4::Heap::TypedArray::Float32Array]); - QV4::ScopedCallData callData(scope, 1); - callData->args[0] = buffer; - constructor->construct(scope, callData); - return QJSValue(m_v4engine, scope.result.asReturnedValue()); + return QJSValue(m_v4engine, constructor->callAsConstructor(buffer, 1)); } // Int32Array (with 2 elements) @@ -4461,10 +4455,7 @@ QJSValue CanvasContext::getParameter(glEnums pname) QV4::ScopedFunctionObject constructor(scope, m_v4engine->typedArrayCtors[ QV4::Heap::TypedArray::Int32Array]); - QV4::ScopedCallData callData(scope, 1); - callData->args[0] = buffer; - constructor->construct(scope, callData); - return QJSValue(m_v4engine, scope.result.asReturnedValue()); + return QJSValue(m_v4engine, constructor->callAsConstructor(buffer, 1)); } // Int32Array (with 4 elements) // Intentional flow through @@ -4480,10 +4471,7 @@ QJSValue CanvasContext::getParameter(glEnums pname) QV4::ScopedFunctionObject constructor(scope, m_v4engine->typedArrayCtors[ QV4::Heap::TypedArray::Int32Array]); - QV4::ScopedCallData callData(scope, 1); - callData->args[0] = buffer; - constructor->construct(scope, callData); - return QJSValue(m_v4engine, scope.result.asReturnedValue()); + return QJSValue(m_v4engine, constructor->callAsConstructor(buffer, 1)); } // sequence<GLboolean> (with 4 values) @@ -4560,10 +4548,7 @@ QJSValue CanvasContext::getParameter(glEnums pname) QV4::ScopedFunctionObject constructor(scope, m_v4engine->typedArrayCtors[ QV4::Heap::TypedArray::UInt32Array]); - QV4::ScopedCallData callData(scope, 1); - callData->args[0] = buffer; - constructor->construct(scope, callData); - return QJSValue(m_v4engine, scope.result.asReturnedValue()); + return QJSValue(m_v4engine, constructor->callAsConstructor(buffer, 1)); } case FRAMEBUFFER_BINDING: { return m_engine->newQObject(m_currentFramebuffer); @@ -5702,10 +5687,7 @@ QJSValue CanvasContext::getVertexAttrib(uint index, glEnums pname) QV4::ScopedFunctionObject constructor(scope, m_v4engine->typedArrayCtors[ QV4::Heap::TypedArray::Float32Array]); - QV4::ScopedCallData callData(scope, 1); - callData->args[0] = buffer; - constructor->construct(scope, callData); - return QJSValue(m_v4engine, scope.result.asReturnedValue()); + return QJSValue(m_v4engine, constructor->callAsConstructor(buffer, 1)); } } default: @@ -5906,10 +5888,7 @@ QJSValue CanvasContext::getUniform(QJSValue program3D, QJSValue location3D) QV4::ScopedFunctionObject constructor(scope, m_v4engine->typedArrayCtors[ QV4::Heap::TypedArray::Int32Array]); - QV4::ScopedCallData callData(scope, 1); - callData->args[0] = buffer; - constructor->construct(scope, callData); - return QJSValue(m_v4engine, scope.result.asReturnedValue()); + return QJSValue(m_v4engine, constructor->callAsConstructor(buffer, 1)); } } case FLOAT_VEC2: @@ -5932,10 +5911,7 @@ QJSValue CanvasContext::getUniform(QJSValue program3D, QJSValue location3D) QV4::ScopedFunctionObject constructor(scope, m_v4engine->typedArrayCtors[ QV4::Heap::TypedArray::Float32Array]); - QV4::ScopedCallData callData(scope, 1); - callData->args[0] = buffer; - constructor->construct(scope, callData); - return QJSValue(m_v4engine, scope.result.asReturnedValue()); + return QJSValue(m_v4engine, constructor->callAsConstructor(buffer, 1)); } } case BOOL_VEC2: @@ -5981,10 +5957,7 @@ QJSValue CanvasContext::getUniform(QJSValue program3D, QJSValue location3D) QV4::ScopedFunctionObject constructor(scope, m_v4engine->typedArrayCtors[ QV4::Heap::TypedArray::Float32Array]); - QV4::ScopedCallData callData(scope, 1); - callData->args[0] = buffer; - constructor->construct(scope, callData); - return QJSValue(m_v4engine, scope.result.asReturnedValue()); + return QJSValue(m_v4engine, constructor->callAsConstructor(buffer, 1)); } } default: diff --git a/src/imports/qtcanvas3d/doc/qtcanvas3d.qdocconf b/src/imports/qtcanvas3d/doc/qtcanvas3d.qdocconf index 7a9cdf3..7314191 100644 --- a/src/imports/qtcanvas3d/doc/qtcanvas3d.qdocconf +++ b/src/imports/qtcanvas3d/doc/qtcanvas3d.qdocconf @@ -13,6 +13,8 @@ sourcedirs += .. examplesinstallpath = canvas3d +manifestmeta.highlighted.names = "QtCanvas3D/Interactive Mobile Phone Example" + depends = qtcore qtgui qtqml qtquick qtquickcontrols qtquicklayouts qtdoc qtmultimedia qhp.projects = QtCanvas3D diff --git a/src/imports/qtcanvas3d/glcommandqueue.cpp b/src/imports/qtcanvas3d/glcommandqueue.cpp index 0a23aae..929d7f8 100644 --- a/src/imports/qtcanvas3d/glcommandqueue.cpp +++ b/src/imports/qtcanvas3d/glcommandqueue.cpp @@ -176,9 +176,9 @@ GlCommand &CanvasGlCommandQueue::queueCommand(CanvasGlCommandQueue::GlCommandId * Copies command data to execute queue. GUI thread must be locked when this * method is called. */ -void CanvasGlCommandQueue::transferCommands(QVector<GlCommand> &executeQueue) +void CanvasGlCommandQueue::transferCommands(GlCommand executeQueue[]) { - memcpy(executeQueue.data(), m_queue.data(), m_queuedCount * sizeof(GlCommand)); + memcpy(executeQueue, m_queue.data(), m_queuedCount * sizeof(GlCommand)); m_queuedCount = 0; diff --git a/src/imports/qtcanvas3d/glcommandqueue_p.h b/src/imports/qtcanvas3d/glcommandqueue_p.h index 1c29009..b40cb66 100644 --- a/src/imports/qtcanvas3d/glcommandqueue_p.h +++ b/src/imports/qtcanvas3d/glcommandqueue_p.h @@ -248,7 +248,7 @@ public: GLint i1, GLint i2, GLfloat p1, GLfloat p2 = 0.0f, GLfloat p3 = 0.0f, GLfloat p4 = 0.0f); - void transferCommands(QVector<GlCommand> &executeQueue); + void transferCommands(GlCommand executeQueue[]); void resetQueue(int size); void deleteUntransferedCommandData(); diff --git a/src/imports/qtcanvas3d/teximage3d.cpp b/src/imports/qtcanvas3d/teximage3d.cpp index d3e1e07..9814e6b 100644 --- a/src/imports/qtcanvas3d/teximage3d.cpp +++ b/src/imports/qtcanvas3d/teximage3d.cpp @@ -47,18 +47,23 @@ QT_BEGIN_NAMESPACE QT_CANVAS3D_BEGIN_NAMESPACE -static QMap<QQmlEngine *,CanvasTextureImageFactory *>m_qmlEngineToImageFactoryMap; -static ulong m_texId = 0; - -class StaticFactoryMapDeleter +class EngineToImageFactoryMap : public QMap<QQmlEngine *, CanvasTextureImageFactory *> { + bool isDeleting = false; public: - StaticFactoryMapDeleter() {} - ~StaticFactoryMapDeleter() { - qDeleteAll(m_qmlEngineToImageFactoryMap); + ~EngineToImageFactoryMap() { + isDeleting = true; + qDeleteAll(*this); + } + void remove(QQmlEngine *e) { + if (isDeleting) + return; + QMap<QQmlEngine *, CanvasTextureImageFactory *>::remove(e); } }; -static StaticFactoryMapDeleter staticFactoryMapDeleter; + +static EngineToImageFactoryMap m_qmlEngineToImageFactoryMap; +static ulong m_texId = 0; CanvasTextureImageFactory::CanvasTextureImageFactory(QQmlEngine *engine, QObject *parent) : QObject(parent) |