eglfs: Fix rotation support with the DRM backends
The change in QEglFSScreen::geometry() was not reflected in the advanced backends that subclass it. Change-Id: I6494a96f0b9afaea3722c61035d4b46bf2473897 Reviewed-by: Andy Nichols <andy.nichols@qt.io>bb10
parent
9ab5c329bf
commit
e9fe0a15a8
|
|
@ -65,7 +65,7 @@ QEglFSScreen::~QEglFSScreen()
|
|||
|
||||
QRect QEglFSScreen::geometry() const
|
||||
{
|
||||
QRect r = geometryForSurface();
|
||||
QRect r = rawGeometry();
|
||||
|
||||
static int rotation = qEnvironmentVariableIntValue("QT_QPA_EGLFS_ROTATION");
|
||||
switch (rotation) {
|
||||
|
|
@ -88,7 +88,7 @@ QRect QEglFSScreen::geometry() const
|
|||
return r;
|
||||
}
|
||||
|
||||
QRect QEglFSScreen::geometryForSurface() const
|
||||
QRect QEglFSScreen::rawGeometry() const
|
||||
{
|
||||
return QRect(QPoint(0, 0), qt_egl_device_integration()->screenSize());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ public:
|
|||
~QEglFSScreen();
|
||||
|
||||
QRect geometry() const Q_DECL_OVERRIDE;
|
||||
QRect geometryForSurface() const;
|
||||
virtual QRect rawGeometry() const;
|
||||
int depth() const Q_DECL_OVERRIDE;
|
||||
QImage::Format format() const Q_DECL_OVERRIDE;
|
||||
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ void QEglFSWindow::create()
|
|||
context->setScreen(window()->screen());
|
||||
if (Q_UNLIKELY(!context->create()))
|
||||
qFatal("EGLFS: Failed to create compositing context");
|
||||
compositor->setTarget(context, window(), screen->geometryForSurface());
|
||||
compositor->setTarget(context, window(), screen->rawGeometry());
|
||||
compositor->setRotation(qEnvironmentVariableIntValue("QT_QPA_EGLFS_ROTATION"));
|
||||
// If there is a "root" window into which raster and QOpenGLWidget content is
|
||||
// composited, all other contexts must share with its context.
|
||||
|
|
@ -190,7 +190,7 @@ void QEglFSWindow::resetSurface()
|
|||
|
||||
m_config = QEglFSDeviceIntegration::chooseConfig(display, platformFormat);
|
||||
m_format = q_glFormatFromConfig(display, m_config, platformFormat);
|
||||
const QSize surfaceSize = screen()->geometryForSurface().size();
|
||||
const QSize surfaceSize = screen()->rawGeometry().size();
|
||||
m_window = qt_egl_device_integration()->createNativeWindow(this, surfaceSize, m_format);
|
||||
m_surface = eglCreateWindowSurface(display, m_config, m_window, NULL);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -130,8 +130,8 @@ gbm_surface *QEglFSKmsGbmScreen::createSurface()
|
|||
if (!m_gbm_surface) {
|
||||
qCDebug(qLcEglfsKmsDebug) << "Creating window for screen" << name();
|
||||
m_gbm_surface = gbm_surface_create(static_cast<QEglFSKmsGbmDevice *>(device())->gbmDevice(),
|
||||
geometry().width(),
|
||||
geometry().height(),
|
||||
rawGeometry().width(),
|
||||
rawGeometry().height(),
|
||||
GBM_FORMAT_XRGB8888,
|
||||
GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -194,8 +194,8 @@ void QEglJetsonTK1Window::resetSurface()
|
|||
m_format = q_glFormatFromConfig(display, m_config);
|
||||
qCDebug(qLcEglfsKmsDebug) << "Stream producer format is" << m_format;
|
||||
|
||||
const int w = cur_screen->geometry().width();
|
||||
const int h = cur_screen->geometry().height();
|
||||
const int w = cur_screen->rawGeometry().width();
|
||||
const int h = cur_screen->rawGeometry().height();
|
||||
qCDebug(qLcEglfsKmsDebug, "Creating stream producer surface of size %dx%d", w, h);
|
||||
|
||||
const EGLint stream_producer_attribs[] = {
|
||||
|
|
|
|||
|
|
@ -98,7 +98,9 @@ QEglFSKmsScreen::~QEglFSKmsScreen()
|
|||
delete m_interruptHandler;
|
||||
}
|
||||
|
||||
QRect QEglFSKmsScreen::geometry() const
|
||||
// Reimplement rawGeometry(), not geometry(). The base class implementation of
|
||||
// geometry() calls rawGeometry() and may apply additional transforms.
|
||||
QRect QEglFSKmsScreen::rawGeometry() const
|
||||
{
|
||||
const int mode = m_output.mode;
|
||||
QRect r(m_pos.x(), m_pos.y(),
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ public:
|
|||
QPoint position);
|
||||
~QEglFSKmsScreen();
|
||||
|
||||
QRect geometry() const Q_DECL_OVERRIDE;
|
||||
QRect rawGeometry() const Q_DECL_OVERRIDE;
|
||||
int depth() const Q_DECL_OVERRIDE;
|
||||
QImage::Format format() const Q_DECL_OVERRIDE;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue