summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp')
-rw-r--r--src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp66
1 files changed, 18 insertions, 48 deletions
diff --git a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
index 7ae042cb50..c986a960f3 100644
--- a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
+++ b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
@@ -58,7 +58,8 @@ QT_BEGIN_NAMESPACE
QQnxRasterBackingStore::QQnxRasterBackingStore(QWindow *window)
: QPlatformBackingStore(window),
- m_hasUnflushedPaintOperations(false)
+ m_needsPosting(false),
+ m_scrolled(false)
{
qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << window;
@@ -85,10 +86,10 @@ void QQnxRasterBackingStore::flush(QWindow *window, const QRegion &region, const
qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << this->window();
// Sometimes this method is called even though there is nothing to be
- // flushed, for instance, after an expose event directly follows a
- // geometry change event.
- if (!m_hasUnflushedPaintOperations)
- return;
+ // flushed (posted in "screen" parlance), for instance, after an expose
+ // event directly follows a geometry change event.
+ if (!m_needsPosting)
+ return;
QQnxWindow *targetWindow = 0;
if (window)
@@ -99,25 +100,11 @@ void QQnxRasterBackingStore::flush(QWindow *window, const QRegion &region, const
// child windows, are performed; conceptually ,child windows have no buffers
// (actually they do have a 1x1 placeholder buffer due to libscreen limitations),
// since Qt will only draw to the backing store of the top-level window.
- if (!targetWindow || targetWindow == platformWindow()) {
+ if (!targetWindow || targetWindow == platformWindow())
+ platformWindow()->post(region); // update the display with newly rendered content
- // visit all pending scroll operations
- for (int i = m_scrollOpList.size() - 1; i >= 0; i--) {
-
- // do the scroll operation
- ScrollOp &op = m_scrollOpList[i];
- QRegion srcArea = op.totalArea.intersected( op.totalArea.translated(-op.dx, -op.dy) );
- platformWindow()->scroll(srcArea, op.dx, op.dy);
- }
-
- // clear all pending scroll operations
- m_scrollOpList.clear();
-
- // update the display with newly rendered content
- platformWindow()->post(region);
- }
-
- m_hasUnflushedPaintOperations = false;
+ m_needsPosting = false;
+ m_scrolled = false;
}
void QQnxRasterBackingStore::resize(const QSize &size, const QRegion &staticContents)
@@ -134,31 +121,14 @@ bool QQnxRasterBackingStore::scroll(const QRegion &area, int dx, int dy)
{
qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << window();
- // calculate entire region affected by scroll operation (src + dst)
- QRegion totalArea = area.translated(dx, dy);
- totalArea += area;
- m_hasUnflushedPaintOperations = true;
-
- // visit all pending scroll operations
- for (int i = m_scrollOpList.size() - 1; i >= 0; i--) {
-
- ScrollOp &op = m_scrollOpList[i];
- if (op.totalArea == totalArea) {
- // same area is being scrolled again - update delta
- op.dx += dx;
- op.dy += dy;
- return true;
- } else if (op.totalArea.intersects(totalArea)) {
- // current scroll overlaps previous scroll but is
- // not equal in area - just paint everything
- qWarning("QQNX: pending scroll operations overlap but not equal");
- return false;
- }
- }
+ m_needsPosting = true;
- // create new scroll operation
- m_scrollOpList.append( ScrollOp(totalArea, dx, dy) );
- return true;
+ if (!m_scrolled) {
+ platformWindow()->scroll(area, dx, dy, true);
+ m_scrolled = true;
+ return true;
+ }
+ return false;
}
void QQnxRasterBackingStore::beginPaint(const QRegion &region)
@@ -166,7 +136,7 @@ void QQnxRasterBackingStore::beginPaint(const QRegion &region)
Q_UNUSED(region);
qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << window();
- m_hasUnflushedPaintOperations = true;
+ m_needsPosting = true;
platformWindow()->adjustBufferSize();