Disable incremental updates for raster windows on QNX

Incremental updates don't always work
due to a misinterpretation of the rectangles passed in by the upper
layers.

Pick-to: 6.8
Change-Id: Id30c97f80904209726b3aaf37c52b2e14ee2f187
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
(cherry picked from commit d0e64a36d2806ae2892cb34cb44ef63b2d56abd1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Felix Lionardo 2025-01-21 15:13:06 -05:00 committed by Qt Cherry-pick Bot
parent a5f12c1ff9
commit 12f59b27e1
2 changed files with 22 additions and 1 deletions

View File

@ -7,6 +7,7 @@
#include "qqnxglobal.h"
#include <QtCore/QDebug>
#include <QtGui/QBackingStore>
#include <errno.h>
@ -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 &region)
platformWindow()->adjustBufferSize();
#if defined(QQNX_INCREMENTAL_RASTER_UPDATE)
if (window()->requestedFormat().alphaBufferSize() > 0) {
auto platformScreen = static_cast<QQnxScreen *>(platformWindow()->screen());
for (const QRect &r : region) {
@ -109,6 +118,10 @@ void QQnxRasterBackingStore::beginPaint(const QRegion &region)
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()

View File

@ -58,6 +58,7 @@ void QQnxRasterWindow::post(const QRegion &dirty)
qCDebug(lcQpaWindow) << Q_FUNC_INFO << "window = " << window();
QQnxBuffer &currentBuffer = 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();