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

View File

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

View File

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

View File

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