linuxfb: Add m prefix to all member variables

Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Reviewed-by: Thomas Senyk <thomas.senyk@nokia.com>

Change-Id: Id1eb31ff15713c4ce3659f71d23a18ecf42f6bd3
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
This commit is contained in:
Girish Ramakrishnan 2012-07-07 08:56:50 +05:30 committed by Qt by Nokia
parent e32ee62c7a
commit 95aa6935a1
4 changed files with 69 additions and 69 deletions

View File

@ -48,7 +48,7 @@
QT_BEGIN_NAMESPACE
QFbScreen::QFbScreen() : mCursor(0), mGeometry(), mDepth(16), mFormat(QImage::Format_RGB16), mScreenImage(0), mCompositePainter(0), isUpToDate(false)
QFbScreen::QFbScreen() : mCursor(0), mGeometry(), mDepth(16), mFormat(QImage::Format_RGB16), mScreenImage(0), mCompositePainter(0), mIsUpToDate(false)
{
}
@ -62,41 +62,41 @@ void QFbScreen::initializeCompositor()
{
mScreenImage = new QImage(mGeometry.size(), mFormat);
redrawTimer.setSingleShot(true);
redrawTimer.setInterval(0);
connect(&redrawTimer, SIGNAL(timeout()), this, SLOT(doRedraw()));
mRedrawTimer.setSingleShot(true);
mRedrawTimer.setInterval(0);
connect(&mRedrawTimer, SIGNAL(timeout()), this, SLOT(doRedraw()));
}
void QFbScreen::addWindow(QFbWindow *window)
{
windowStack.prepend(window);
mWindowStack.prepend(window);
invalidateRectCache();
setDirty(window->geometry());
}
void QFbScreen::removeWindow(QFbWindow *window)
{
windowStack.removeOne(window);
mWindowStack.removeOne(window);
invalidateRectCache();
setDirty(window->geometry());
}
void QFbScreen::raise(QFbWindow *window)
{
int index = windowStack.indexOf(window);
int index = mWindowStack.indexOf(window);
if (index <= 0)
return;
windowStack.move(index, 0);
mWindowStack.move(index, 0);
invalidateRectCache();
setDirty(window->geometry());
}
void QFbScreen::lower(QFbWindow *window)
{
int index = windowStack.indexOf(window);
if (index == -1 || index == (windowStack.size() - 1))
int index = mWindowStack.indexOf(window);
if (index == -1 || index == (mWindowStack.size() - 1))
return;
windowStack.move(index, windowStack.size() - 1);
mWindowStack.move(index, mWindowStack.size() - 1);
invalidateRectCache();
setDirty(window->geometry());
}
@ -105,11 +105,11 @@ QWindow *QFbScreen::topLevelAt(const QPoint & p) const
{
Q_UNUSED(p);
#if 0
for (int i = 0; i < windowStack.size(); i++) {
if (windowStack[i]->geometry().contains(p, false) &&
windowStack[i]->visible() &&
!windowStack[i]->widget()->isMinimized()) {
return windowStack[i]->widget();
for (int i = 0; i < mWindowStack.size(); i++) {
if (mWindowStack[i]->geometry().contains(p, false) &&
mWindowStack[i]->visible() &&
!mWindowStack[i]->widget()->isMinimized()) {
return mWindowStack[i]->widget();
}
}
#endif
@ -120,41 +120,41 @@ void QFbScreen::setDirty(const QRect &rect)
{
QRect intersection = rect.intersected(mGeometry);
QPoint screenOffset = mGeometry.topLeft();
repaintRegion += intersection.translated(-screenOffset); // global to local translation
if (!redrawTimer.isActive()) {
redrawTimer.start();
mRepaintRegion += intersection.translated(-screenOffset); // global to local translation
if (!mRedrawTimer.isActive()) {
mRedrawTimer.start();
}
}
void QFbScreen::generateRects()
{
cachedRects.clear();
mCachedRects.clear();
QPoint screenOffset = mGeometry.topLeft();
QRegion remainingScreen(mGeometry.translated(-screenOffset)); // global to local translation
for (int i = 0; i < windowStack.length(); i++) {
for (int i = 0; i < mWindowStack.length(); i++) {
if (remainingScreen.isEmpty())
break;
#if 0
if (!windowStack[i]->isVisible())
if (!mWindowStack[i]->isVisible())
continue;
if (windowStack[i]->isMinimized())
if (mWindowStack[i]->isMinimized())
continue;
if (!windowStack[i]->testAttribute(Qt::WA_TranslucentBackground)) {
QRect localGeometry = windowStack.at(i)->geometry().translated(-screenOffset); // global to local translation
if (!mWindowStack[i]->testAttribute(Qt::WA_TranslucentBackground)) {
QRect localGeometry = mWindowStack.at(i)->geometry().translated(-screenOffset); // global to local translation
remainingScreen -= localGeometry;
QRegion windowRegion(localGeometry);
windowRegion -= remainingScreen;
foreach (QRect rect, windowRegion.rects()) {
cachedRects += QPair<QRect, int>(rect, i);
mCachedRects += QPair<QRect, int>(rect, i);
}
}
#endif
}
foreach (QRect rect, remainingScreen.rects())
cachedRects += QPair<QRect, int>(rect, -1);
isUpToDate = true;
mCachedRects += QPair<QRect, int>(rect, -1);
mIsUpToDate = true;
return;
}
@ -165,25 +165,25 @@ QRegion QFbScreen::doRedraw()
QRegion touchedRegion;
if (mCursor && mCursor->isDirty() && mCursor->isOnScreen()) {
QRect lastCursor = mCursor->dirtyRect();
repaintRegion += lastCursor;
mRepaintRegion += lastCursor;
}
if (repaintRegion.isEmpty() && (!mCursor || !mCursor->isDirty())) {
if (mRepaintRegion.isEmpty() && (!mCursor || !mCursor->isDirty())) {
return touchedRegion;
}
QVector<QRect> rects = repaintRegion.rects();
QVector<QRect> rects = mRepaintRegion.rects();
if (!isUpToDate)
if (!mIsUpToDate)
generateRects();
if (!mCompositePainter)
mCompositePainter = new QPainter(mScreenImage);
for (int rectIndex = 0; rectIndex < repaintRegion.rectCount(); rectIndex++) {
for (int rectIndex = 0; rectIndex < mRepaintRegion.rectCount(); rectIndex++) {
QRegion rectRegion = rects[rectIndex];
for (int i = 0; i < cachedRects.length(); i++) {
QRect screenSubRect = cachedRects[i].first;
int layer = cachedRects[i].second;
for (int i = 0; i < mCachedRects.length(); i++) {
QRect screenSubRect = mCachedRects[i].first;
int layer = mCachedRects[i].second;
QRegion intersect = rectRegion.intersected(screenSubRect);
if (intersect.isEmpty())
@ -197,18 +197,18 @@ QRegion QFbScreen::doRedraw()
if (layer == -1) {
mCompositePainter->fillRect(rect, Qt::black);
firstLayer = false;
layer = windowStack.size() - 1;
layer = mWindowStack.size() - 1;
}
for (int layerIndex = layer; layerIndex != -1; layerIndex--) {
if (!windowStack[layerIndex]->isVisible())
if (!mWindowStack[layerIndex]->isVisible())
continue;
// if (windowStack[layerIndex]->isMinimized())
// if (mWindowStack[layerIndex]->isMinimized())
// continue;
QRect windowRect = windowStack[layerIndex]->geometry().translated(-screenOffset);
QRect windowRect = mWindowStack[layerIndex]->geometry().translated(-screenOffset);
QRect windowIntersect = rect.translated(-windowRect.left(),
-windowRect.top());
mCompositePainter->drawImage(rect, windowStack[layerIndex]->backingStore()->image(),
mCompositePainter->drawImage(rect, mWindowStack[layerIndex]->backingStore()->image(),
windowIntersect);
if (firstLayer) {
firstLayer = false;
@ -219,16 +219,16 @@ QRegion QFbScreen::doRedraw()
}
QRect cursorRect;
if (mCursor && (mCursor->isDirty() || repaintRegion.intersects(mCursor->lastPainted()))) {
if (mCursor && (mCursor->isDirty() || mRepaintRegion.intersects(mCursor->lastPainted()))) {
cursorRect = mCursor->drawCursor(*mCompositePainter);
touchedRegion += cursorRect;
}
touchedRegion += repaintRegion;
repaintRegion = QRegion();
touchedRegion += mRepaintRegion;
mRepaintRegion = QRegion();
// qDebug() << "QFbScreen::doRedraw" << windowStack.size() << mScreenImage->size() << touchedRegion;
// qDebug() << "QFbScreen::doRedraw" << mWindowStack.size() << mScreenImage->size() << touchedRegion;
return touchedRegion;

View File

@ -79,9 +79,9 @@ protected slots:
protected:
void initializeCompositor();
QList<QFbWindow *> windowStack;
QRegion repaintRegion;
QTimer redrawTimer;
QList<QFbWindow *> mWindowStack;
QRegion mRepaintRegion;
QTimer mRedrawTimer;
QFbCursor *mCursor;
QRect mGeometry;
@ -91,14 +91,14 @@ protected:
QImage *mScreenImage;
private:
void invalidateRectCache() { isUpToDate = false; }
void invalidateRectCache() { mIsUpToDate = false; }
void generateRects();
QPainter *mCompositePainter;
QList<QPair<QRect, int> > cachedRects;
QList<QPair<QRect, int> > mCachedRects;
friend class QFbWindow;
bool isUpToDate;
bool mIsUpToDate;
};
QT_END_NAMESPACE

View File

@ -47,10 +47,10 @@
QT_BEGIN_NAMESPACE
QFbWindow::QFbWindow(QWindow *window)
: QPlatformWindow(window), mBackingStore(0), visibleFlag(false)
: QPlatformWindow(window), mBackingStore(0), mVisible(false)
{
static QAtomicInt winIdGenerator(1);
windowId = winIdGenerator.fetchAndAddRelaxed(1);
mWindowId = winIdGenerator.fetchAndAddRelaxed(1);
platformScreen()->addWindow(this);
}
@ -68,7 +68,7 @@ QFbScreen *QFbWindow::platformScreen() const
void QFbWindow::setGeometry(const QRect &rect)
{
// store previous geometry for screen update
oldGeometry = geometry();
mOldGeometry = geometry();
platformScreen()->invalidateRectCache();
//### QWindowSystemInterface::handleGeometryChange(window(), rect);
@ -78,21 +78,21 @@ void QFbWindow::setGeometry(const QRect &rect)
void QFbWindow::setVisible(bool visible)
{
visibleFlag = visible;
mVisible = visible;
platformScreen()->invalidateRectCache();
platformScreen()->setDirty(geometry());
}
Qt::WindowFlags QFbWindow::setWindowFlags(Qt::WindowFlags type)
Qt::WindowFlags QFbWindow::setWindowFlags(Qt::WindowFlags flags)
{
flags = type;
mWindowFlags = flags;
platformScreen()->invalidateRectCache();
return flags;
return mWindowFlags;
}
Qt::WindowFlags QFbWindow::windowFlags() const
{
return flags;
return mWindowFlags;
}
void QFbWindow::raise()
@ -114,11 +114,11 @@ void QFbWindow::repaint(const QRegion &region)
currentGeometry.top() + dirtyClient.top(),
dirtyClient.width(),
dirtyClient.height());
QRect oldGeometryLocal = oldGeometry;
oldGeometry = currentGeometry;
QRect mOldGeometryLocal = mOldGeometry;
mOldGeometry = currentGeometry;
// If this is a move, redraw the previous location
if (oldGeometryLocal != currentGeometry)
platformScreen()->setDirty(oldGeometryLocal);
if (mOldGeometryLocal != currentGeometry)
platformScreen()->setDirty(mOldGeometryLocal);
platformScreen()->setDirty(dirtyRegion);
}

View File

@ -56,7 +56,7 @@ public:
~QFbWindow();
virtual void setVisible(bool visible);
virtual bool isVisible() { return visibleFlag; }
virtual bool isVisible() { return mVisible; }
virtual void raise();
virtual void lower();
@ -66,7 +66,7 @@ public:
virtual Qt::WindowFlags setWindowFlags(Qt::WindowFlags type);
virtual Qt::WindowFlags windowFlags() const;
WId winId() const { return windowId; }
WId winId() const { return mWindowId; }
void setBackingStore(QFbBackingStore *store) { mBackingStore = store; }
QFbBackingStore *backingStore() const { return mBackingStore; }
@ -79,11 +79,11 @@ protected:
friend class QFbScreen;
QFbBackingStore *mBackingStore;
QRect oldGeometry;
bool visibleFlag;
Qt::WindowFlags flags;
QRect mOldGeometry;
bool mVisible;
Qt::WindowFlags mWindowFlags;
WId windowId;
WId mWindowId;
};
QT_END_NAMESPACE