summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-02-09 09:59:27 +0100
committerSean Harmer <sean.harmer@kdab.com>2015-02-09 15:45:43 +0000
commit9837a5735fae7a24c3ec9b528c08ebffb955fc20 (patch)
tree416da5e3114babf82ad59d8496347bcaf0fa0def /src
parentdf0bcb540c94bd676c52508832843eade0da5d3b (diff)
Avoid rendering to non-exposed windows
Change-Id: I784e7a9833324da0330d70f8a16d8bf64cf6db08 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/render/backend/qgraphicscontext.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/render/backend/qgraphicscontext.cpp b/src/render/backend/qgraphicscontext.cpp
index 0df30e3fd..75eb217c2 100644
--- a/src/render/backend/qgraphicscontext.cpp
+++ b/src/render/backend/qgraphicscontext.cpp
@@ -61,6 +61,7 @@
#include <Qt3DRenderer/private/qgraphicshelperes2_p.h>
#include <QSurface>
+#include <QWindow>
#include <QOpenGLTexture>
QT_BEGIN_NAMESPACE
@@ -138,6 +139,11 @@ bool QGraphicsContext::beginDrawing(QSurface *surface, const QColor &clearColor)
m_surface = surface;
+ if (m_surface && m_surface->surfaceClass() == QSurface::Window) {
+ if (!static_cast<QWindow *>(m_surface)->isExposed())
+ return false;
+ }
+
bool ok = m_gl->makeCurrent(m_surface);
if (!ok) {
qCWarning(Backend) << Q_FUNC_INFO << "make current failed";