[backends/hwcomposer] Base HwcomposerScreens on BasicScreens
This commit is contained in:
parent
eb81ddfb86
commit
57a3cea142
3 changed files with 6 additions and 41 deletions
|
@ -53,6 +53,10 @@ public:
|
||||||
Screens *createScreens(QObject *parent = nullptr) override;
|
Screens *createScreens(QObject *parent = nullptr) override;
|
||||||
OpenGLBackend *createOpenGLBackend() override;
|
OpenGLBackend *createOpenGLBackend() override;
|
||||||
|
|
||||||
|
QSize screenSize() const override {
|
||||||
|
return m_displaySize;
|
||||||
|
}
|
||||||
|
|
||||||
HwcomposerWindow *createSurface();
|
HwcomposerWindow *createSurface();
|
||||||
|
|
||||||
QSize size() const {
|
QSize size() const {
|
||||||
|
|
|
@ -24,47 +24,13 @@ namespace KWin
|
||||||
{
|
{
|
||||||
|
|
||||||
HwcomposerScreens::HwcomposerScreens(HwcomposerBackend *backend, QObject *parent)
|
HwcomposerScreens::HwcomposerScreens(HwcomposerBackend *backend, QObject *parent)
|
||||||
: Screens(parent)
|
: BasicScreens(backend, parent)
|
||||||
, m_backend(backend)
|
, m_backend(backend)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
HwcomposerScreens::~HwcomposerScreens() = default;
|
HwcomposerScreens::~HwcomposerScreens() = default;
|
||||||
|
|
||||||
void HwcomposerScreens::init()
|
|
||||||
{
|
|
||||||
Screens::init();
|
|
||||||
updateCount();
|
|
||||||
emit changed();
|
|
||||||
}
|
|
||||||
|
|
||||||
QRect HwcomposerScreens::geometry(int screen) const
|
|
||||||
{
|
|
||||||
if (screen == 0) {
|
|
||||||
return QRect(QPoint(0, 0), size(screen));
|
|
||||||
}
|
|
||||||
return QRect();
|
|
||||||
}
|
|
||||||
|
|
||||||
QSize HwcomposerScreens::size(int screen) const
|
|
||||||
{
|
|
||||||
if (screen == 0) {
|
|
||||||
return m_backend->size();
|
|
||||||
}
|
|
||||||
return QSize();
|
|
||||||
}
|
|
||||||
|
|
||||||
void HwcomposerScreens::updateCount()
|
|
||||||
{
|
|
||||||
setCount(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
int HwcomposerScreens::number(const QPoint &pos) const
|
|
||||||
{
|
|
||||||
Q_UNUSED(pos)
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
float HwcomposerScreens::refreshRate(int screen) const
|
float HwcomposerScreens::refreshRate(int screen) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(screen)
|
Q_UNUSED(screen)
|
||||||
|
|
|
@ -25,17 +25,12 @@ namespace KWin
|
||||||
{
|
{
|
||||||
class HwcomposerBackend;
|
class HwcomposerBackend;
|
||||||
|
|
||||||
class HwcomposerScreens : public Screens
|
class HwcomposerScreens : public BasicScreens
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
HwcomposerScreens(HwcomposerBackend *backend, QObject *parent = nullptr);
|
HwcomposerScreens(HwcomposerBackend *backend, QObject *parent = nullptr);
|
||||||
virtual ~HwcomposerScreens();
|
virtual ~HwcomposerScreens();
|
||||||
void init() override;
|
|
||||||
QRect geometry(int screen) const override;
|
|
||||||
int number(const QPoint &pos) const override;
|
|
||||||
QSize size(int screen) const override;
|
|
||||||
void updateCount() override;
|
|
||||||
float refreshRate(int screen) const override;
|
float refreshRate(int screen) const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in a new issue