summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
diff options
context:
space:
mode:
authorRafael Roquetto <rafael.roquetto.qnx@kdab.com>2013-05-06 19:17:52 -0300
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-05-09 14:56:32 +0200
commit6dfba7c62896a3fd35869f73f99dc8e34d543854 (patch)
treef28e7c5cd4becfb3d6d5a81106b30a789d9c6234 /src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
parent46685f755b01288fd53c4483cb97a22c426a57f0 (diff)
QNX: Use 'disabled' child window buffers.
Because there is only one QBackingStore per top-level window, child windows do not need to have their own buffer, since Qt will use the TLW backing store as their drawing surface. Since QNX's libscreen does not support windows without buffer, a 1x1 buffer is used instead. Change-Id: I4b81fdd0f3e6059c46b1d4302d2a754d72dc8a68 Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Diffstat (limited to 'src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp')
-rw-r--r--src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp28
1 files changed, 5 insertions, 23 deletions
diff --git a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
index 7204e5bce9..17b0d06245 100644
--- a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
+++ b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
@@ -85,6 +85,11 @@ void QQnxRasterBackingStore::flush(QWindow *window, const QRegion &region, const
if (window)
targetWindow = static_cast<QQnxWindow *>(window->handle());
+ // we only need to flush the platformWindow backing store, since this is
+ // the buffer where all drawing operations of all windows, including the
+ // 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.
QQnxWindow *platformWindow = this->platformWindow();
if (!targetWindow || targetWindow == platformWindow) {
@@ -102,29 +107,6 @@ void QQnxRasterBackingStore::flush(QWindow *window, const QRegion &region, const
// update the display with newly rendered content
platformWindow->post(region);
- } else if (targetWindow) {
-
- // The contents of the backing store should be flushed to a different window than the
- // window which owns the buffer.
- // This typically happens for child windows, since child windows share a backing store with
- // their top-level window (TLW).
- // Simply copy the buffer over to the child window, to emulate a painting operation, and
- // then post the window.
- //
- // ### Note that because of the design in the QNX QPA plugin, each window has its own buffers,
- // even though they might share a backing store. This is unneeded overhead, but I don't think
- // libscreen allows to have windows without buffers, or does it?
-
- // We assume that the TLW has been flushed previously and that no changes were made to the
- // backing store inbetween (### does Qt guarantee this?)
- Q_ASSERT(!m_hasUnflushedPaintOperations);
-
- targetWindow->adjustBufferSize();
- targetWindow->blitFrom(platformWindow, offset, region);
- targetWindow->post(region);
-
- } else {
- qWarning() << Q_FUNC_INFO << "flush() called without a valid window!";
}
m_hasUnflushedPaintOperations = false;