linuxfb: remove mScreens from QFbWindow

A QWindow can only be in one QScreen, so it makes no sense to track
a list of screens.

Change-Id: I341a67afa90c7fbbbd95786b43d0a322fc1ddba2
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Reviewed-by: Thomas Senyk <thomas.senyk@nokia.com>
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
bb10
Girish Ramakrishnan 2012-07-06 04:14:37 +05:30 committed by Qt by Nokia
parent 4f5a9c8791
commit 0be4073708
3 changed files with 46 additions and 78 deletions

View File

@ -252,7 +252,6 @@ QRegion QFbScreen::doRedraw()
void QFbScreen::addWindow(QFbWindow *surface)
{
windowStack.prepend(surface);
surface->mScreens.append(this);
invalidateRectCache();
setDirty(surface->geometry());
}
@ -260,7 +259,6 @@ void QFbScreen::addWindow(QFbWindow *surface)
void QFbScreen::removeWindow(QFbWindow * surface)
{
windowStack.removeOne(surface);
surface->mScreens.removeOne(this);
invalidateRectCache();
setDirty(surface->geometry());
}

View File

@ -42,54 +42,10 @@
#include "qfbwindow_p.h"
#include "qfbscreen_p.h"
#include <QtGui/QScreen>
QT_BEGIN_NAMESPACE
void QFbWindow::setGeometry(const QRect &rect)
{
// store previous geometry for screen update
oldGeometry = geometry();
QList<QFbScreen *>::const_iterator i = mScreens.constBegin();
QList<QFbScreen *>::const_iterator end = mScreens.constEnd();
while (i != end) {
(*i)->invalidateRectCache();
++i;
}
//### QWindowSystemInterface::handleGeometryChange(window(), rect);
QPlatformWindow::setGeometry(rect);
}
void QFbWindow::setVisible(bool visible)
{
visibleFlag = visible;
QList<QFbScreen *>::const_iterator i = mScreens.constBegin();
QList<QFbScreen *>::const_iterator end = mScreens.constEnd();
while (i != end) {
(*i)->invalidateRectCache();
(*i)->setDirty(geometry());
++i;
}
}
Qt::WindowFlags QFbWindow::setWindowFlags(Qt::WindowFlags type)
{
flags = type;
QList<QFbScreen *>::const_iterator i = mScreens.constBegin();
QList<QFbScreen *>::const_iterator end = mScreens.constEnd();
while (i != end) {
(*i)->invalidateRectCache();
++i;
}
return flags;
}
Qt::WindowFlags QFbWindow::windowFlags() const
{
return flags;
}
QFbWindow::QFbWindow(QWindow *window)
: QPlatformWindow(window), mBackingStore(0), visibleFlag(false)
{
@ -99,32 +55,52 @@ QFbWindow::QFbWindow(QWindow *window)
QFbWindow::~QFbWindow()
{
QList<QFbScreen *>::const_iterator i = mScreens.constBegin();
QList<QFbScreen *>::const_iterator end = mScreens.constEnd();
while (i != end) {
(*i)->removeWindow(this);
++i;
}
platformScreen()->removeWindow(this);
}
QFbScreen *QFbWindow::platformScreen() const
{
return static_cast<QFbScreen *>(window()->screen()->handle());
}
void QFbWindow::setGeometry(const QRect &rect)
{
// store previous geometry for screen update
oldGeometry = geometry();
platformScreen()->invalidateRectCache();
//### QWindowSystemInterface::handleGeometryChange(window(), rect);
QPlatformWindow::setGeometry(rect);
}
void QFbWindow::setVisible(bool visible)
{
visibleFlag = visible;
platformScreen()->invalidateRectCache();
platformScreen()->setDirty(geometry());
}
Qt::WindowFlags QFbWindow::setWindowFlags(Qt::WindowFlags type)
{
flags = type;
platformScreen()->invalidateRectCache();
return flags;
}
Qt::WindowFlags QFbWindow::windowFlags() const
{
return flags;
}
void QFbWindow::raise()
{
QList<QFbScreen *>::const_iterator i = mScreens.constBegin();
QList<QFbScreen *>::const_iterator end = mScreens.constEnd();
while (i != end) {
(*i)->raise(this);
++i;
}
platformScreen()->raise(this);
}
void QFbWindow::lower()
{
QList<QFbScreen *>::const_iterator i = mScreens.constBegin();
QList<QFbScreen *>::const_iterator end = mScreens.constEnd();
while (i != end) {
(*i)->lower(this);
++i;
}
platformScreen()->lower(this);
}
void QFbWindow::repaint(const QRegion &region)
@ -136,20 +112,13 @@ void QFbWindow::repaint(const QRegion &region)
currentGeometry.top() + dirtyClient.top(),
dirtyClient.width(),
dirtyClient.height());
QList<QFbScreen *>::const_iterator i = mScreens.constBegin();
QList<QFbScreen *>::const_iterator end = mScreens.constEnd();
QRect oldGeometryLocal = oldGeometry;
oldGeometry = currentGeometry;
while (i != end) {
// If this is a move, redraw the previous location
if (oldGeometryLocal != currentGeometry) {
(*i)->setDirty(oldGeometryLocal);
}
(*i)->setDirty(dirtyRegion);
++i;
}
// If this is a move, redraw the previous location
if (oldGeometryLocal != currentGeometry)
platformScreen()->setDirty(oldGeometryLocal);
platformScreen()->setDirty(dirtyRegion);
}
QT_END_NAMESPACE

View File

@ -71,13 +71,14 @@ public:
void setBackingStore(QFbBackingStore *store) { mBackingStore = store; }
QFbBackingStore *backingStore() const { return mBackingStore; }
QFbScreen *platformScreen() const;
virtual void repaint(const QRegion&);
protected:
friend class QFbScreen;
QFbBackingStore *mBackingStore;
QList<QFbScreen *> mScreens;
QRect oldGeometry;
bool visibleFlag;
Qt::WindowFlags flags;