1
/********************************************************************
2
KWin - the KDE window manager
3
This file is part of the KDE project.
5
Copyright (C) 2015 Martin Gräßlin <mgraesslin@kde.org>
7
This program is free software; you can redistribute it and/or modify
8
it under the terms of the GNU General Public License as published by
9
the Free Software Foundation; either version 3 of the License, or
10
(at your option) any later version.
12
This program is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
GNU General Public License for more details.
17
You should have received a copy of the GNU General Public License
18
along with this program. If not, see <http://www.gnu.org/licenses/>.
19
*********************************************************************/
20
#ifndef KWIN_HWCOMPOSER_BACKEND_H
21
#define KWIN_HWCOMPOSER_BACKEND_H
22
#include "abstract_backend.h"
25
#include <hwcomposer_window.h>
26
// needed as hwcomposer_window.h includes EGL which on non-arm includes Xlib
29
typedef struct hwc_display_contents_1 hwc_display_contents_1_t;
30
typedef struct hwc_layer_1 hwc_layer_1_t;
31
typedef struct hwc_composer_device_1 hwc_composer_device_1_t;
33
struct AndroidEventListener;
38
class HwcomposerWindow;
40
class HwcomposerBackend : public AbstractBackend
43
Q_INTERFACES(KWin::AbstractBackend)
44
Q_PLUGIN_METADATA(IID "org.kde.kwin.AbstractBackend" FILE "hwcomposer.json")
46
explicit HwcomposerBackend(QObject *parent = nullptr);
47
virtual ~HwcomposerBackend();
50
Screens *createScreens(QObject *parent = nullptr) override;
51
OpenGLBackend *createOpenGLBackend() override;
53
HwcomposerWindow *createSurface();
59
hwc_composer_device_1_t *device() const {
62
int refreshRate() const {
67
void toggleBlankOutput();
70
static void inputEvent(Event *event, void *context);
73
hwc_composer_device_1_t *m_device = nullptr;
74
AndroidEventListener *m_inputListener = nullptr;
75
bool m_outputBlank = true;
76
int m_refreshRate = 60000;
79
class HwcomposerWindow : public HWComposerNativeWindow
82
virtual ~HwcomposerWindow();
87
friend HwcomposerBackend;
88
HwcomposerWindow(HwcomposerBackend *backend);
89
HwcomposerBackend *m_backend;
90
hwc_display_contents_1_t **m_list;