diff options
Diffstat (limited to 'src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp')
-rw-r--r-- | src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp | 94 |
1 files changed, 28 insertions, 66 deletions
diff --git a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp index 7ae042cb50..33488309bf 100644 --- a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp +++ b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp @@ -5,36 +5,28 @@ ** ** This file is part of the plugins of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $QT_BEGIN_LICENSE:LGPL21$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** ** $QT_END_LICENSE$ ** ****************************************************************************/ @@ -58,7 +50,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 +78,10 @@ void QQnxRasterBackingStore::flush(QWindow *window, const QRegion ®ion, 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 +92,11 @@ void QQnxRasterBackingStore::flush(QWindow *window, const QRegion ®ion, 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()) { - - // 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(); + if (!targetWindow || targetWindow == platformWindow()) + platformWindow()->post(region); // update the display with newly rendered content - // 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 +113,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 ®ion) @@ -166,7 +128,7 @@ void QQnxRasterBackingStore::beginPaint(const QRegion ®ion) Q_UNUSED(region); qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << window(); - m_hasUnflushedPaintOperations = true; + m_needsPosting = true; platformWindow()->adjustBufferSize(); |