diff --git a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp index b94c056a799..e6b787ccf7c 100644 --- a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp +++ b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp @@ -7,6 +7,7 @@ #include "qqnxglobal.h" #include +#include #include @@ -74,7 +75,14 @@ bool QQnxRasterBackingStore::scroll(const QRegion &area, int dx, int dy) m_needsPosting = true; if (!m_scrolled) { +#if defined(QQNX_INCREMENTAL_RASTER_UPDATE) platformWindow()->scroll(area, dx, dy, true); +#else + platformWindow()->scroll(area, dx, dy, false); + QRegion remainder = QRect(QPoint(0, 0), backingStore()->size()); + remainder -= area.translated(dx, dy); + platformWindow()->scroll(remainder, 0, 0, true); +#endif m_scrolled = true; return true; } @@ -90,6 +98,7 @@ void QQnxRasterBackingStore::beginPaint(const QRegion ®ion) platformWindow()->adjustBufferSize(); +#if defined(QQNX_INCREMENTAL_RASTER_UPDATE) if (window()->requestedFormat().alphaBufferSize() > 0) { auto platformScreen = static_cast(platformWindow()->screen()); for (const QRect &r : region) { @@ -109,6 +118,10 @@ void QQnxRasterBackingStore::beginPaint(const QRegion ®ion) Q_SCREEN_CHECKERROR(screen_flush_blits(platformScreen->nativeContext(), SCREEN_WAIT_IDLE), "failed to flush blits"); } +#else + if (!m_scrolled) + platformWindow()->scroll(QRect(QPoint(0, 0), backingStore()->size()), 0, 0, true); +#endif } void QQnxRasterBackingStore::endPaint() diff --git a/src/plugins/platforms/qnx/qqnxrasterwindow.cpp b/src/plugins/platforms/qnx/qqnxrasterwindow.cpp index 303c9e7c064..72442035b40 100644 --- a/src/plugins/platforms/qnx/qqnxrasterwindow.cpp +++ b/src/plugins/platforms/qnx/qqnxrasterwindow.cpp @@ -58,6 +58,7 @@ void QQnxRasterWindow::post(const QRegion &dirty) qCDebug(lcQpaWindow) << Q_FUNC_INFO << "window = " << window(); QQnxBuffer ¤tBuffer = m_buffers[m_currentBufferIndex]; +#if defined(QQNX_INCREMENTAL_RASTER_UPDATE) // Copy unmodified region from old render buffer to new render buffer; // required to allow partial updates QRegion preserve = m_previousDirty - dirty - m_scrolled; @@ -72,6 +73,12 @@ void QQnxRasterWindow::post(const QRegion &dirty) Q_SCREEN_CHECKERROR( screen_post_window(nativeHandle(), currentBuffer.nativeBuffer(), 1, dirtyRect, 0), "Failed to post window"); +#else + // Update the display with contents of render buffer + Q_SCREEN_CHECKERROR( + screen_post_window(nativeHandle(), currentBuffer.nativeBuffer(), 0, NULL, 0), + "Failed to post window"); +#endif // Advance to next nender buffer m_previousBufferIndex = m_currentBufferIndex++; @@ -79,7 +86,7 @@ void QQnxRasterWindow::post(const QRegion &dirty) m_currentBufferIndex = 0; // Save modified region and clear scrolled region - m_previousDirty = dirty; + m_previousDirty = QRect(QPoint(0, 0), window()->size()); m_scrolled = QRegion(); windowPosted(); @@ -149,6 +156,7 @@ int QQnxRasterWindow::pixelFormat() const void QQnxRasterWindow::resetBuffers() { // Buffers were destroyed; reacquire them + m_previousBufferIndex = -1; m_currentBufferIndex = -1; m_previousDirty = QRegion(); m_scrolled = QRegion();