qpa: avoid useless resize in DirectFB platform

Check current size before resizing QDirectFbBackingStore through
its resize() method to avoid useless deallocation/reallocation.

Change-Id: Idc32eb20d3d3cac988fa9dd2feb80910303f5763
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
This commit is contained in:
Julien Brianceau 2012-09-13 11:05:53 +02:00 committed by Qt by Nokia
parent 5f974a4faf
commit 6a15a784f4

View File

@ -82,6 +82,12 @@ void QDirectFbBackingStore::flush(QWindow *, const QRegion &region, const QPoint
void QDirectFbBackingStore::resize(const QSize &size, const QRegion& reg)
{
Q_UNUSED(reg);
if ((m_pmdata->width() == size.width()) &&
(m_pmdata->height() == size.height()))
return;
QDirectFbBlitter *blitter = new QDirectFbBlitter(size, m_dfbSurface.data());
m_pmdata->setBlittable(blitter);
}