diff options
author | Andy Nichols <andy.nichols@qt.io> | 2017-02-27 16:45:44 +0100 |
---|---|---|
committer | Andy Nichols <andy.nichols@qt.io> | 2017-02-28 19:21:12 +0000 |
commit | 55fec6b2db17db43fc7d03ef5d482cc67b16543b (patch) | |
tree | 29b8d547606fcbc788e7822d1aef4bb913a7de9c /src/quick/scenegraph | |
parent | 9bd2705a2f02d1c54f179aa096142c151046c642 (diff) |
Software: Flush whole window on Expose event
The software render loop updates the window content via either an expose
event or an update event. An expose event should always flush the entire
backingstore, but previously only the newly updated region would be
flushed. The first time a window is exposed this is fine because the whole
scene would be rendered, but when hidden and shown again, the software
renderer might show that nothing has changed, and nothing would be
flushed. A new flag has been added that forces a full window flush for an
expose event.
Task-number: QTBUG-59177
Change-Id: I3700bbcc76bc97be4eb0c822e2945ebef339f11a
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/quick/scenegraph')
-rw-r--r-- | src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp | 9 | ||||
-rw-r--r-- | src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop_p.h | 2 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp index 6856d34616..b3b8274a73 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp @@ -101,7 +101,7 @@ void QSGSoftwareRenderLoop::windowDestroyed(QQuickWindow *window) } } -void QSGSoftwareRenderLoop::renderWindow(QQuickWindow *window) +void QSGSoftwareRenderLoop::renderWindow(QQuickWindow *window, bool isNewExpose) { QQuickWindowPrivate *cd = QQuickWindowPrivate::get(window); if (!m_windows.contains(window)) @@ -174,7 +174,10 @@ void QSGSoftwareRenderLoop::renderWindow(QQuickWindow *window) if (alsoSwap && window->isVisible()) { //Flush backingstore to window - m_backingStores[window]->flush(softwareRenderer->flushRegion()); + if (!isNewExpose) + m_backingStores[window]->flush(softwareRenderer->flushRegion()); + else + m_backingStores[window]->flush(QRegion(QRect(QPoint(0,0), window->size()))); cd->fireFrameSwapped(); } @@ -206,7 +209,7 @@ void QSGSoftwareRenderLoop::exposureChanged(QQuickWindow *window) { if (window->isExposed()) { m_windows[window].updatePending = true; - renderWindow(window); + renderWindow(window, true); } } diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop_p.h b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop_p.h index 02dcf4eefa..c724d18298 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop_p.h +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop_p.h @@ -69,7 +69,7 @@ public: void windowDestroyed(QQuickWindow *window) override; - void renderWindow(QQuickWindow *window); + void renderWindow(QQuickWindow *window, bool isNewExpose = false); void exposureChanged(QQuickWindow *window) override; QImage grab(QQuickWindow *window) override; |