From: Friedemann Kleint Date: Thu, 4 Oct 2012 10:15:49 +0000 (+0200) Subject: Change Q_ASSERTs in qquick[threaded]windowmanager.cpp to qWarning(). X-Git-Tag: upstream/5.2.1~1100 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e0521a579e967d670a5f6d7d4a4cd90a6aa56e17;p=platform%2Fupstream%2Fqtdeclarative.git Change Q_ASSERTs in qquick[threaded]windowmanager.cpp to qWarning(). As they also triggers when a non-existing file is loaded into QML2 or windows have invalid sizes. Change-Id: Iab1ce6c99f2bc2cb360ddaccce539cb97979ad5a Reviewed-by: Kai Koehne Reviewed-by: Christiaan Janssen --- diff --git a/src/quick/items/qquickthreadedwindowmanager.cpp b/src/quick/items/qquickthreadedwindowmanager.cpp index 50bd569..fac4fb0 100644 --- a/src/quick/items/qquickthreadedwindowmanager.cpp +++ b/src/quick/items/qquickthreadedwindowmanager.cpp @@ -43,6 +43,7 @@ #include "qquickthreadedwindowmanager_p.h" #include +#include #include #include @@ -396,20 +397,24 @@ void QQuickRenderThreadSingleContextWindowManager::run() WindowData *windowData = it.value(); QQuickWindowPrivate *windowPrivate = QQuickWindowPrivate::get(window); - Q_ASSERT(windowPrivate->isRenderable()); - - gl->makeCurrent(window); + if (windowPrivate->isRenderable()) { + gl->makeCurrent(window); - if (windowData->viewportSize != windowData->windowSize) { + if (windowData->viewportSize != windowData->windowSize) { #ifdef THREAD_DEBUG - printf(" RenderThread: --- window has changed size...\n"); + printf(" RenderThread: --- window has changed size...\n"); #endif - windowData->viewportSize = windowData->windowSize; - windowData->sizeWasChanged = true; - glViewport(0, 0, windowData->viewportSize.width(), windowData->viewportSize.height()); - } + windowData->viewportSize = windowData->windowSize; + windowData->sizeWasChanged = true; + glViewport(0, 0, windowData->viewportSize.width(), windowData->viewportSize.height()); + } - windowPrivate->syncSceneGraph(); + windowPrivate->syncSceneGraph(); + } else { + qWarning().nospace() + << "Non-renderable window " << window + << " (" << window->geometry() << ")."; + } } inSync = false; diff --git a/src/quick/items/qquickwindowmanager.cpp b/src/quick/items/qquickwindowmanager.cpp index dd27182..50887e8 100644 --- a/src/quick/items/qquickwindowmanager.cpp +++ b/src/quick/items/qquickwindowmanager.cpp @@ -225,7 +225,13 @@ void QQuickTrivialWindowManager::renderWindow(QQuickWindow *window) if (!masterWindow) return; - Q_ASSERT(QQuickWindowPrivate::get(masterWindow)->isRenderable()); + if (!QQuickWindowPrivate::get(masterWindow)->isRenderable()) { + qWarning().nospace() + << "Unable to find a renderable master window " + << masterWindow << "when trying to render" + << window << " (" << window->geometry() << ")."; + return; + } if (!gl) { gl = new QOpenGLContext();