From 57a3cea14214b14b2c8cd43c0a76ab1bb5f26b51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Tue, 17 Nov 2015 10:49:09 +0100 Subject: [PATCH] [backends/hwcomposer] Base HwcomposerScreens on BasicScreens --- backends/hwcomposer/hwcomposer_backend.h | 4 +++ backends/hwcomposer/screens_hwcomposer.cpp | 36 +--------------------- backends/hwcomposer/screens_hwcomposer.h | 7 +---- 3 files changed, 6 insertions(+), 41 deletions(-) diff --git a/backends/hwcomposer/hwcomposer_backend.h b/backends/hwcomposer/hwcomposer_backend.h index a6d85ea35f..27efc38aab 100644 --- a/backends/hwcomposer/hwcomposer_backend.h +++ b/backends/hwcomposer/hwcomposer_backend.h @@ -53,6 +53,10 @@ public: Screens *createScreens(QObject *parent = nullptr) override; OpenGLBackend *createOpenGLBackend() override; + QSize screenSize() const override { + return m_displaySize; + } + HwcomposerWindow *createSurface(); QSize size() const { diff --git a/backends/hwcomposer/screens_hwcomposer.cpp b/backends/hwcomposer/screens_hwcomposer.cpp index 63a5e376c8..b1e2c5ac01 100644 --- a/backends/hwcomposer/screens_hwcomposer.cpp +++ b/backends/hwcomposer/screens_hwcomposer.cpp @@ -24,47 +24,13 @@ namespace KWin { HwcomposerScreens::HwcomposerScreens(HwcomposerBackend *backend, QObject *parent) - : Screens(parent) + : BasicScreens(backend, parent) , m_backend(backend) { } 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 { Q_UNUSED(screen) diff --git a/backends/hwcomposer/screens_hwcomposer.h b/backends/hwcomposer/screens_hwcomposer.h index 6c32e873a4..4c7c213dcb 100644 --- a/backends/hwcomposer/screens_hwcomposer.h +++ b/backends/hwcomposer/screens_hwcomposer.h @@ -25,17 +25,12 @@ namespace KWin { class HwcomposerBackend; -class HwcomposerScreens : public Screens +class HwcomposerScreens : public BasicScreens { Q_OBJECT public: HwcomposerScreens(HwcomposerBackend *backend, QObject *parent = nullptr); 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; private: