aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickwindowmanager.cpp
diff options
context:
space:
mode:
authorBalazs Kelemen <kbalazs@webkit.org>2012-09-27 12:24:25 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-09-28 18:50:32 +0200
commit75445c228476e4905cef3fb89a849f93f33e768f (patch)
treef8a9cb3a9eca2e85e8893e57078d912870d3ad3a /src/quick/items/qquickwindowmanager.cpp
parente03363dfd1aeddd085c4c86d9a1964da769d7980 (diff)
Allow grabbing windows rendered without showing for testing.
To make QQuickWindowPrivate::setRenderWithoutShowing more useful for autotesting we can allow grabbing such windows. This is safe if the platform window have been created and the window has a valid size. Change-Id: I8b9a2aaeb93935f662b75ef29651730b890441d5 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com> Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'src/quick/items/qquickwindowmanager.cpp')
-rw-r--r--src/quick/items/qquickwindowmanager.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/quick/items/qquickwindowmanager.cpp b/src/quick/items/qquickwindowmanager.cpp
index 43887662eb..6596343bc8 100644
--- a/src/quick/items/qquickwindowmanager.cpp
+++ b/src/quick/items/qquickwindowmanager.cpp
@@ -198,13 +198,14 @@ void QQuickTrivialWindowManager::windowDestroyed(QQuickWindow *window)
void QQuickTrivialWindowManager::renderWindow(QQuickWindow *window)
{
- if (!window->isExposed() || !m_windows.contains(window))
+ bool renderWithoutShowing = QQuickWindowPrivate::get(window)->renderWithoutShowing;
+ if ((!window->isExposed() && !renderWithoutShowing) || !m_windows.contains(window))
return;
WindowData &data = const_cast<WindowData &>(m_windows[window]);
QQuickWindow *masterWindow = 0;
- if (!window->isVisible()) {
+ if (!window->isVisible() && !renderWithoutShowing) {
// Find a "proper surface" to bind...
for (QHash<QQuickWindow *, WindowData>::const_iterator it = m_windows.constBegin();
it != m_windows.constEnd() && !masterWindow; ++it) {
@@ -218,6 +219,8 @@ void QQuickTrivialWindowManager::renderWindow(QQuickWindow *window)
if (!masterWindow)
return;
+ Q_ASSERT(QQuickWindowPrivate::get(masterWindow)->isRenderable());
+
if (!gl) {
gl = new QOpenGLContext();
gl->setFormat(masterWindow->requestedFormat());