summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2014-02-28 14:35:03 +0200
committerTomi Korpipää <tomi.korpipaa@digia.com>2014-03-03 06:20:57 +0200
commite0731bfb32188f1b5ae6eed43094cb6eb62efc8c (patch)
treec58ba001815ff688ee43cfcd7a5b24eb284cd026
parent478b96d840750abaadbc6bdfcbcd7c9c04449117 (diff)
Remove the invalid renderer deletion from context switch.
Multiwindow case is still broken, though. Added note to code about it. Change-Id: Iec381d362469a8b2cf998c52f807b5c855526b22 Reviewed-by: Tomi Korpipää <tomi.korpipaa@digia.com>
-rw-r--r--src/datavisualizationqml2/abstractdeclarative.cpp21
1 files changed, 4 insertions, 17 deletions
diff --git a/src/datavisualizationqml2/abstractdeclarative.cpp b/src/datavisualizationqml2/abstractdeclarative.cpp
index e7a5c7eb..e517c177 100644
--- a/src/datavisualizationqml2/abstractdeclarative.cpp
+++ b/src/datavisualizationqml2/abstractdeclarative.cpp
@@ -239,14 +239,7 @@ void AbstractDeclarative::activateOpenGLContext(QQuickWindow *window)
if (!m_context || !m_qtContext || m_contextWindow != window) {
QOpenGLContext *currentContext = QOpenGLContext::currentContext();
- if (m_context && currentContext != m_qtContext) {
- // If Qt context has changed, the old renderer needs to go.
- // If the old context window no longer exists, it is okay to delete renderer
- // in null context, as we can assume Qt context for the window is also gone.
- m_context->makeCurrent(m_contextWindow);
- m_controller->destroyRenderer();
- m_context->doneCurrent(); // So that we don't delete active context
- }
+ // Note: Changing graph to different window when using multithreaded renderer will break!
delete m_context;
@@ -270,20 +263,14 @@ void AbstractDeclarative::activateOpenGLContext(QQuickWindow *window)
if (!m_stateStore || !m_qtContext || m_contextWindow != window) {
QOpenGLContext *currentContext = QOpenGLContext::currentContext();
- if (m_qtContext && currentContext != m_qtContext) {
- // If Qt context has changed but still exists, the old renderer needs to go.
- // If the old context window no longer exists, it is okay to delete renderer
- // in null context (though it is likely Qt context is gone in that case, too.)
- m_qtContext->makeCurrent(m_contextWindow);
- m_controller->destroyRenderer();
- currentContext->makeCurrent(window);
- }
+ // Note: Changing graph to different window when using multithreaded renderer will break!
+
+ delete m_stateStore;
m_contextThread = QThread::currentThread();
m_contextWindow = window;
m_qtContext = currentContext;
- delete m_stateStore;
m_stateStore = new GLStateStore(QOpenGLContext::currentContext());
m_stateStore->storeGLState();