eglfs: Fix QT_QPA_EGLFS_ROTATION with the KMS/DRM screeen

It overrides geometry().

Change-Id: I93c607567d7cb688221d200dcd47c1a6ba23b26b
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
This commit is contained in:
Laszlo Agocs 2016-08-08 12:06:40 +02:00
parent af7b4e3f55
commit e930425228

View File

@ -101,9 +101,29 @@ QEglFSKmsScreen::~QEglFSKmsScreen()
QRect QEglFSKmsScreen::geometry() const
{
const int mode = m_output.mode;
return QRect(m_pos.x(), m_pos.y(),
QRect r(m_pos.x(), m_pos.y(),
m_output.modes[mode].hdisplay,
m_output.modes[mode].vdisplay);
static int rotation = qEnvironmentVariableIntValue("QT_QPA_EGLFS_ROTATION");
switch (rotation) {
case 0:
case 180:
case -180:
break;
case 90:
case -90: {
int h = r.height();
r.setHeight(r.width());
r.setWidth(h);
break;
}
default:
qWarning("Invalid rotation %d specified in QT_QPA_EGLFS_ROTATION", rotation);
break;
}
return r;
}
int QEglFSKmsScreen::depth() const