EglFS: allow the hook to override logicalDpi()
Task-number: QTBUG-29674 Change-Id: Id88a8735ceb7f5bcb63344b3b0653486a6caa70d Reviewed-by: Samuel Rødal <samuel.rodal@digia.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
This commit is contained in:
parent
9b7c66ac7f
commit
a658d26d84
@ -43,6 +43,7 @@
|
|||||||
#define QEGLFSHOOKS_H
|
#define QEGLFSHOOKS_H
|
||||||
|
|
||||||
#include <qpa/qplatformintegration.h>
|
#include <qpa/qplatformintegration.h>
|
||||||
|
#include <qpa/qplatformscreen.h>
|
||||||
#include <QtGui/QSurfaceFormat>
|
#include <QtGui/QSurfaceFormat>
|
||||||
#include <QtGui/QImage>
|
#include <QtGui/QImage>
|
||||||
#include <EGL/egl.h>
|
#include <EGL/egl.h>
|
||||||
@ -61,6 +62,7 @@ public:
|
|||||||
virtual EGLNativeDisplayType platformDisplay() const;
|
virtual EGLNativeDisplayType platformDisplay() const;
|
||||||
virtual QSizeF physicalScreenSize() const;
|
virtual QSizeF physicalScreenSize() const;
|
||||||
virtual QSize screenSize() const;
|
virtual QSize screenSize() const;
|
||||||
|
virtual QDpi logicalDpi() const;
|
||||||
virtual int screenDepth() const;
|
virtual int screenDepth() const;
|
||||||
virtual QImage::Format screenFormat() const;
|
virtual QImage::Format screenFormat() const;
|
||||||
virtual QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &inputFormat) const;
|
virtual QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &inputFormat) const;
|
||||||
|
@ -178,6 +178,15 @@ QSize QEglFSHooks::screenSize() const
|
|||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QDpi QEglFSHooks::logicalDpi() const
|
||||||
|
{
|
||||||
|
QSizeF ps = physicalScreenSize();
|
||||||
|
QSize s = screenSize();
|
||||||
|
|
||||||
|
return QDpi(25.4 * s.width() / ps.width(),
|
||||||
|
25.4 * s.height() / ps.height());
|
||||||
|
}
|
||||||
|
|
||||||
int QEglFSHooks::screenDepth() const
|
int QEglFSHooks::screenDepth() const
|
||||||
{
|
{
|
||||||
static int depth = qgetenv("QT_QPA_EGLFS_DEPTH").toInt();
|
static int depth = qgetenv("QT_QPA_EGLFS_DEPTH").toInt();
|
||||||
|
@ -88,6 +88,12 @@ QSizeF QEglFSScreen::physicalSize() const
|
|||||||
return QEglFSHooks::hooks()->physicalScreenSize();
|
return QEglFSHooks::hooks()->physicalScreenSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QDpi QEglFSScreen::logicalDpi() const
|
||||||
|
{
|
||||||
|
return QEglFSHooks::hooks()->logicalDpi();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
QPlatformCursor *QEglFSScreen::cursor() const
|
QPlatformCursor *QEglFSScreen::cursor() const
|
||||||
{
|
{
|
||||||
return m_cursor;
|
return m_cursor;
|
||||||
|
@ -64,6 +64,7 @@ public:
|
|||||||
QImage::Format format() const;
|
QImage::Format format() const;
|
||||||
|
|
||||||
QSizeF physicalSize() const;
|
QSizeF physicalSize() const;
|
||||||
|
QDpi logicalDpi() const;
|
||||||
|
|
||||||
QPlatformCursor *cursor() const;
|
QPlatformCursor *cursor() const;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user