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.9 6.8 Change-Id: Id30c97f80904209726b3aaf37c52b2e14ee2f187 Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
This commit is contained in:
parent
ad7b94e163
commit
d0e64a36d2
@ -7,6 +7,7 @@
|
|||||||
#include "qqnxglobal.h"
|
#include "qqnxglobal.h"
|
||||||
|
|
||||||
#include <QtCore/QDebug>
|
#include <QtCore/QDebug>
|
||||||
|
#include <QtGui/QBackingStore>
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
@ -74,7 +75,14 @@ bool QQnxRasterBackingStore::scroll(const QRegion &area, int dx, int dy)
|
|||||||
m_needsPosting = true;
|
m_needsPosting = true;
|
||||||
|
|
||||||
if (!m_scrolled) {
|
if (!m_scrolled) {
|
||||||
|
#if defined(QQNX_INCREMENTAL_RASTER_UPDATE)
|
||||||
platformWindow()->scroll(area, dx, dy, true);
|
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;
|
m_scrolled = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -90,6 +98,7 @@ void QQnxRasterBackingStore::beginPaint(const QRegion ®ion)
|
|||||||
|
|
||||||
platformWindow()->adjustBufferSize();
|
platformWindow()->adjustBufferSize();
|
||||||
|
|
||||||
|
#if defined(QQNX_INCREMENTAL_RASTER_UPDATE)
|
||||||
if (window()->requestedFormat().alphaBufferSize() > 0) {
|
if (window()->requestedFormat().alphaBufferSize() > 0) {
|
||||||
auto platformScreen = static_cast<QQnxScreen *>(platformWindow()->screen());
|
auto platformScreen = static_cast<QQnxScreen *>(platformWindow()->screen());
|
||||||
for (const QRect &r : region) {
|
for (const QRect &r : region) {
|
||||||
@ -109,6 +118,10 @@ void QQnxRasterBackingStore::beginPaint(const QRegion ®ion)
|
|||||||
Q_SCREEN_CHECKERROR(screen_flush_blits(platformScreen->nativeContext(),
|
Q_SCREEN_CHECKERROR(screen_flush_blits(platformScreen->nativeContext(),
|
||||||
SCREEN_WAIT_IDLE), "failed to flush blits");
|
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()
|
void QQnxRasterBackingStore::endPaint()
|
||||||
|
@ -58,6 +58,7 @@ void QQnxRasterWindow::post(const QRegion &dirty)
|
|||||||
qCDebug(lcQpaWindow) << Q_FUNC_INFO << "window = " << window();
|
qCDebug(lcQpaWindow) << Q_FUNC_INFO << "window = " << window();
|
||||||
QQnxBuffer ¤tBuffer = m_buffers[m_currentBufferIndex];
|
QQnxBuffer ¤tBuffer = m_buffers[m_currentBufferIndex];
|
||||||
|
|
||||||
|
#if defined(QQNX_INCREMENTAL_RASTER_UPDATE)
|
||||||
// Copy unmodified region from old render buffer to new render buffer;
|
// Copy unmodified region from old render buffer to new render buffer;
|
||||||
// required to allow partial updates
|
// required to allow partial updates
|
||||||
QRegion preserve = m_previousDirty - dirty - m_scrolled;
|
QRegion preserve = m_previousDirty - dirty - m_scrolled;
|
||||||
@ -72,6 +73,12 @@ void QQnxRasterWindow::post(const QRegion &dirty)
|
|||||||
Q_SCREEN_CHECKERROR(
|
Q_SCREEN_CHECKERROR(
|
||||||
screen_post_window(nativeHandle(), currentBuffer.nativeBuffer(), 1, dirtyRect, 0),
|
screen_post_window(nativeHandle(), currentBuffer.nativeBuffer(), 1, dirtyRect, 0),
|
||||||
"Failed to post window");
|
"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
|
// Advance to next nender buffer
|
||||||
m_previousBufferIndex = m_currentBufferIndex++;
|
m_previousBufferIndex = m_currentBufferIndex++;
|
||||||
@ -79,7 +86,7 @@ void QQnxRasterWindow::post(const QRegion &dirty)
|
|||||||
m_currentBufferIndex = 0;
|
m_currentBufferIndex = 0;
|
||||||
|
|
||||||
// Save modified region and clear scrolled region
|
// Save modified region and clear scrolled region
|
||||||
m_previousDirty = dirty;
|
m_previousDirty = QRect(QPoint(0, 0), window()->size());
|
||||||
m_scrolled = QRegion();
|
m_scrolled = QRegion();
|
||||||
|
|
||||||
windowPosted();
|
windowPosted();
|
||||||
@ -149,6 +156,7 @@ int QQnxRasterWindow::pixelFormat() const
|
|||||||
void QQnxRasterWindow::resetBuffers()
|
void QQnxRasterWindow::resetBuffers()
|
||||||
{
|
{
|
||||||
// Buffers were destroyed; reacquire them
|
// Buffers were destroyed; reacquire them
|
||||||
|
m_previousBufferIndex = -1;
|
||||||
m_currentBufferIndex = -1;
|
m_currentBufferIndex = -1;
|
||||||
m_previousDirty = QRegion();
|
m_previousDirty = QRegion();
|
||||||
m_scrolled = QRegion();
|
m_scrolled = QRegion();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user