diff options
author | Jędrzej Nowacki <jedrzej.nowacki@digia.com> | 2013-01-07 16:57:32 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-01-07 18:07:29 +0100 |
commit | ae2359d49e171c61450b17b1eb0e0dd7a20c7ca4 (patch) | |
tree | fbf5ef281002a47659d80405ae38f48b57e19c22 /src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp | |
parent | 998899cf3a2501d3bf30ad06ce47a2cf81e1d60b (diff) | |
parent | cdf13ce286b14273e1e29c5bb02cbc880f31b786 (diff) |
Merge "Merge branch 'stable' into dev" into refs/staging/dev
Diffstat (limited to 'src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp')
-rw-r--r-- | src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp | 25 |
1 files changed, 16 insertions, 9 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 ®ion, 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 ®ion, 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 ®ion, 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 ®ion) qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << window(); m_hasUnflushedPaintOperations = true; - m_platformWindow->adjustBufferSize(); + platformWindow()->adjustBufferSize(); } void QQnxRasterBackingStore::endPaint(const QRegion ®ion) @@ -186,4 +187,10 @@ void QQnxRasterBackingStore::endPaint(const QRegion ®ion) 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 |