linuxfb: create image only on resize

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

Change-Id: I04cd75f96cf755ef0c12fad70e3bbd96fbbed9a1
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
This commit is contained in:
Girish Ramakrishnan 2012-07-05 22:00:28 +05:30 committed by Qt by Nokia
parent c452418e9f
commit 4f5a9c8791
2 changed files with 3 additions and 11 deletions

View File

@ -51,7 +51,6 @@ QT_BEGIN_NAMESPACE
QFbBackingStore::QFbBackingStore(QWindow *window)
: QPlatformBackingStore(window)
{
mImage = QImage(window->size(), window->screen()->handle()->format());
(static_cast<QFbWindow *>(window->handle()))->setBackingStore(this);
}
@ -67,18 +66,12 @@ void QFbBackingStore::flush(QWindow *window, const QRegion &region, const QPoint
(static_cast<QFbWindow *>(window->handle()))->repaint(region);
}
void QFbBackingStore::resize(const QSize &size, const QRegion &region)
void QFbBackingStore::resize(const QSize &size, const QRegion &staticContents)
{
Q_UNUSED(region);
// change the widget's QImage if this is a resize
Q_UNUSED(staticContents);
if (mImage.size() != size)
mImage = QImage(size, window()->screen()->handle()->format());
// QPlatformBackingStore::resize(size);
}
bool QFbBackingStore::scroll(const QRegion &area, int dx, int dy)
{
return QPlatformBackingStore::scroll(area, dx, dy);
}
void QFbBackingStore::beginPaint(const QRegion &region)

View File

@ -58,7 +58,6 @@ public:
virtual QPaintDevice *paintDevice() { return &mImage; }
virtual void flush(QWindow *window, const QRegion &region, const QPoint &offset);
virtual bool scroll(const QRegion &area, int dx, int dy);
virtual void beginPaint(const QRegion &region);
virtual void endPaint(const QRegion &region);