linuxfb: don't store window in backingstore
The backing store already knows about the window. Also, rename surface to backing store in QFbWindow. Change-Id: I3701b3cdbdc228200da9b93b13037655dc436f53 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
569ea8c365
commit
c452418e9f
|
|
@ -44,17 +44,15 @@
|
|||
#include "qfbscreen_p.h"
|
||||
|
||||
#include <qpa/qplatformwindow.h>
|
||||
#include <QtGui/qscreen.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
QFbBackingStore::QFbBackingStore(QFbScreen *screen, QWindow *window)
|
||||
: QPlatformBackingStore(window),
|
||||
mScreen(screen)
|
||||
QFbBackingStore::QFbBackingStore(QWindow *window)
|
||||
: QPlatformBackingStore(window)
|
||||
{
|
||||
mImage = QImage(window->size(), mScreen->format());
|
||||
|
||||
platformWindow = static_cast<QFbWindow*>(window->handle());
|
||||
platformWindow->surface = this;
|
||||
mImage = QImage(window->size(), window->screen()->handle()->format());
|
||||
(static_cast<QFbWindow *>(window->handle()))->setBackingStore(this);
|
||||
}
|
||||
|
||||
QFbBackingStore::~QFbBackingStore()
|
||||
|
|
@ -66,7 +64,7 @@ void QFbBackingStore::flush(QWindow *window, const QRegion ®ion, const QPoint
|
|||
Q_UNUSED(window);
|
||||
Q_UNUSED(offset);
|
||||
|
||||
platformWindow->repaint(region);
|
||||
(static_cast<QFbWindow *>(window->handle()))->repaint(region);
|
||||
}
|
||||
|
||||
void QFbBackingStore::resize(const QSize &size, const QRegion ®ion)
|
||||
|
|
@ -74,7 +72,7 @@ void QFbBackingStore::resize(const QSize &size, const QRegion ®ion)
|
|||
Q_UNUSED(region);
|
||||
// change the widget's QImage if this is a resize
|
||||
if (mImage.size() != size)
|
||||
mImage = QImage(size, mScreen->format());
|
||||
mImage = QImage(size, window()->screen()->handle()->format());
|
||||
// QPlatformBackingStore::resize(size);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ class QWindow;
|
|||
class QFbBackingStore : public QPlatformBackingStore
|
||||
{
|
||||
public:
|
||||
QFbBackingStore(QFbScreen *screen, QWindow *window);
|
||||
QFbBackingStore(QWindow *window);
|
||||
~QFbBackingStore();
|
||||
|
||||
virtual QPaintDevice *paintDevice() { return &mImage; }
|
||||
|
|
@ -63,14 +63,13 @@ public:
|
|||
virtual void beginPaint(const QRegion ®ion);
|
||||
virtual void endPaint(const QRegion ®ion);
|
||||
|
||||
virtual void resize(const QSize &size, const QRegion ®ion);
|
||||
|
||||
const QImage image() { return mImage; }
|
||||
void resize(const QSize &size, const QRegion ®ion);
|
||||
|
||||
protected:
|
||||
friend class QFbWindow;
|
||||
QFbWindow *platformWindow;
|
||||
|
||||
QFbScreen *mScreen;
|
||||
QImage mImage;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -223,7 +223,7 @@ QRegion QFbScreen::doRedraw()
|
|||
QRect windowRect = windowStack[layerIndex]->geometry().translated(-screenOffset);
|
||||
QRect windowIntersect = rect.translated(-windowRect.left(),
|
||||
-windowRect.top());
|
||||
compositePainter->drawImage(rect, windowStack[layerIndex]->surface->image(),
|
||||
compositePainter->drawImage(rect, windowStack[layerIndex]->backingStore()->image(),
|
||||
windowIntersect);
|
||||
if (firstLayer) {
|
||||
firstLayer = false;
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ Qt::WindowFlags QFbWindow::windowFlags() const
|
|||
}
|
||||
|
||||
QFbWindow::QFbWindow(QWindow *window)
|
||||
: QPlatformWindow(window), visibleFlag(false)
|
||||
: QPlatformWindow(window), mBackingStore(0), visibleFlag(false)
|
||||
{
|
||||
static QAtomicInt winIdGenerator(1);
|
||||
windowId = winIdGenerator.fetchAndAddRelaxed(1);
|
||||
|
|
|
|||
|
|
@ -68,13 +68,15 @@ public:
|
|||
|
||||
WId winId() const { return windowId; }
|
||||
|
||||
void setBackingStore(QFbBackingStore *store) { mBackingStore = store; }
|
||||
QFbBackingStore *backingStore() const { return mBackingStore; }
|
||||
|
||||
virtual void repaint(const QRegion&);
|
||||
|
||||
protected:
|
||||
friend class QFbScreen;
|
||||
friend class QFbBackingStore;
|
||||
|
||||
QFbBackingStore *surface;
|
||||
QFbBackingStore *mBackingStore;
|
||||
QList<QFbScreen *> mScreens;
|
||||
QRect oldGeometry;
|
||||
bool visibleFlag;
|
||||
|
|
|
|||
|
|
@ -804,8 +804,7 @@ QPlatformPixmap *QLinuxFbIntegration::createPlatformPixmap(QPlatformPixmap::Pixe
|
|||
|
||||
QPlatformBackingStore *QLinuxFbIntegration::createPlatformBackingStore(QWindow *window) const
|
||||
{
|
||||
QFbBackingStore *surface = new QFbBackingStore(mPrimaryScreen, window);
|
||||
return surface;
|
||||
return new QFbBackingStore(window);
|
||||
}
|
||||
|
||||
QPlatformWindow *QLinuxFbIntegration::createPlatformWindow(QWindow *window) const
|
||||
|
|
|
|||
Loading…
Reference in New Issue