summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp25
-rw-r--r--src/plugins/platforms/qnx/qqnxrasterbackingstore.h4
2 files changed, 19 insertions, 10 deletions
diff --git a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
index 11babe3aaa..47a72f173b 100644
--- a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
+++ b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
@@ -60,8 +60,7 @@ QQnxRasterBackingStore::QQnxRasterBackingStore(QWindow *window)
{
qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << window;
- // save platform window associated with widget
- m_platformWindow = static_cast<QQnxWindow*>(window->handle());
+ m_window = window;
}
QQnxRasterBackingStore::~QQnxRasterBackingStore()
@@ -71,8 +70,9 @@ QQnxRasterBackingStore::~QQnxRasterBackingStore()
QPaintDevice *QQnxRasterBackingStore::paintDevice()
{
- if (m_platformWindow->hasBuffers())
- return m_platformWindow->renderBuffer().image();
+ QQnxWindow *platformWindow = this->platformWindow();
+ if (platformWindow->hasBuffers())
+ return platformWindow->renderBuffer().image();
return 0;
}
@@ -85,7 +85,8 @@ void QQnxRasterBackingStore::flush(QWindow *window, const QRegion &region, const
if (window)
targetWindow = static_cast<QQnxWindow *>(window->handle());
- if (!targetWindow || targetWindow == m_platformWindow) {
+ QQnxWindow *platformWindow = this->platformWindow();
+ if (!targetWindow || targetWindow == platformWindow) {
// visit all pending scroll operations
for (int i = m_scrollOpList.size() - 1; i >= 0; i--) {
@@ -93,14 +94,14 @@ void QQnxRasterBackingStore::flush(QWindow *window, const QRegion &region, const
// do the scroll operation
ScrollOp &op = m_scrollOpList[i];
QRegion srcArea = op.totalArea.intersected( op.totalArea.translated(-op.dx, -op.dy) );
- m_platformWindow->scroll(srcArea, 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
- m_platformWindow->post(region);
+ platformWindow->post(region);
} else if (targetWindow) {
// The contents of the backing store should be flushed to a different window than the
@@ -119,7 +120,7 @@ void QQnxRasterBackingStore::flush(QWindow *window, const QRegion &region, const
Q_ASSERT(!m_hasUnflushedPaintOperations);
targetWindow->adjustBufferSize();
- targetWindow->blitFrom(m_platformWindow, offset, region);
+ targetWindow->blitFrom(platformWindow, offset, region);
targetWindow->post(region);
} else {
@@ -177,7 +178,7 @@ void QQnxRasterBackingStore::beginPaint(const QRegion &region)
qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << window();
m_hasUnflushedPaintOperations = true;
- m_platformWindow->adjustBufferSize();
+ platformWindow()->adjustBufferSize();
}
void QQnxRasterBackingStore::endPaint(const QRegion &region)
@@ -186,4 +187,10 @@ void QQnxRasterBackingStore::endPaint(const QRegion &region)
qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << window();
}
+QQnxWindow *QQnxRasterBackingStore::platformWindow() const
+{
+ Q_ASSERT(m_window->handle());
+ return static_cast<QQnxWindow*>(m_window->handle());
+}
+
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/qnx/qqnxrasterbackingstore.h b/src/plugins/platforms/qnx/qqnxrasterbackingstore.h
index 8abd81f217..a344ff209d 100644
--- a/src/plugins/platforms/qnx/qqnxrasterbackingstore.h
+++ b/src/plugins/platforms/qnx/qqnxrasterbackingstore.h
@@ -72,7 +72,9 @@ private:
int dy;
};
- QQnxWindow *m_platformWindow;
+ QQnxWindow *platformWindow() const;
+
+ QWindow *m_window;
QList<ScrollOp> m_scrollOpList;
bool m_hasUnflushedPaintOperations;
};