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
parent
4f5a9c8791
commit
0be4073708
|
|
@ -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());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 ®ion)
|
||||
|
|
@ -136,20 +112,13 @@ void QFbWindow::repaint(const QRegion ®ion)
|
|||
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
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue